-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add constructors for values of type Omd.doc
#268
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7259e32
add constructors for values of type `Omd.doc`
tatchi f913b59
remove attributes for {soft,hard}_break and hr
tatchi ab6c48d
fmt
tatchi 40a3cad
update names
tatchi 759c364
Merge branch 'master' into add-constructors
shonfeder 1db13d5
Merge branch 'master' into add-constructors
shonfeder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this more closely now, I think we should come up with a clear rationale for how we name these functions. Note that I see these names are taken from my initial sketch in the originating issue, so this is me reconsidering my initial half backed suggestion :)
Some of these are named after the HTMl entities, some are named after the value constructor of the AST's sum types, and some (namely
blq
anddef_list
) have abbreviations I don't associate with any standard source.I see three options:
dl
fordef_list
andcode_bl
forcode_block
?What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I like to have short names for the function constructors. Option 2 is quite invasive so I would go for option 3.
When possible, we can try to match the Tyxml API? We can take some inspiration from: https://github.com/ocaml/omd/pull/211/files#diff-16f58dc281193a8336f88df2eeb14760638cfc1ce4a2a1c479c509e33f39738f
And for the rest, well, we can try to do our best 😅
That would give something like:
blockquote
feels a bit different to me since that's the only one that isn't abbreviated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thinking to look to TyXml!
I think blockquote is ok, despite the disparity, since it matches the html tag and the TyXml constructor.
These generally look ok to me. My only point of concern is around the
a
function. The markdown links seems to not really map exactly onto to general html anchors, but rather be a special case of them. But maybe I am over thinking that a bit.Lastly, since we are not tending towards the side of making the function names match the value constructors perfectly, what would you think about this for the breaks?
I think this matches the semantics of these things fairly well, and
br
fits the TyXml and HTML I think?WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense to me :)
I updated the code, thanks for your suggestions 🤗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for the PR and sorry for the very loooong turn around in merging this in. :)