-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
wip: mdoc reader #10225
Draft
silby
wants to merge
81
commits into
jgm:main
Choose a base branch
from
silby:mdoc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
wip: mdoc reader #10225
Changes from all commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
68ec788
Start Mdoc lexer
silby b4bf4f4
Start mdoc reader
silby 419ec78
Register the mdoc reader
silby f44074e
Checkpoint
silby b301ee0
stash pandoc.cabal nopub
silby fe1659d
Use standard spaceChar
silby 35900e9
Consume spaces when lexing mdoc control tokens
silby 5038334
Backtrack delim lexing
silby fd2ee1b
Delete some traces
silby d88e71d
Remove skip to end
silby eec5178
Lex blank mdoc lines
silby f4383b9
Handle blanks in mdoc parser
silby 353943c
Comment upon parseStr's output
silby 5a56e5d
Remove unused/redundant imports
silby 754ffc8
Make more progress on inlines/paras
silby e1eddf6
Add parsing of code blocks from mdoc
silby 9e44bb6
tktk: Unify roff escapes
silby a714f9d
Comment upon my approach
silby 4431651
Add Xr parser
silby 759d327
Lex callable macros in parsed control lines
silby 784a873
Correct comments
silby 1e8f7b7
Parse Nm macro (outside Sh NAME)
silby 57c9709
Parse multiple inline macros per control line
silby 34a83d9
Add a deprecated macro synonym
silby a3a892a
Plan for special handling of AUTHORS
silby 4b3ecb8
Correct pasted comment
silby 91f24a0
Add macros for line-scoped enclosures
silby 497477d
Add Qq
silby 7131923
Extract spacify function
silby 1f5da9a
Rework enclosures and support multiline ones
silby 10bdda8
fixup: qq
silby 41f1454
Add Op macro
silby 03d82ba
Add partial Ns support
silby ffe16cc
Lex called macros better
silby 87097af
Lex inner quotes in quoted args correctly
silby fbd18a2
Handle the Ns macro
silby f988804
fixup: Remove Do trace
silby 83a523d
Lex quoted delimiters on control lines
silby 6ed3d83
Start Mdoc tests
silby 12f4c49
Use lineEnclosure to parse Sh/Ss
silby 3691891
Add Oo/Op macro
silby f8d263f
Handle Ns at end of control line correctly
silby e6d6dd9
Add the No macro
silby d319de0
Lex quoted callable macros as macros
silby 30e3fce
Convert some more Ns tests from mandoc
silby 608bbb2
Add more mandoc regress tests
silby bb3db9c
Add remaining multiline enclosures
silby 07ea56e
Fix actual multiline enclosures
silby ee6be32
Remove YAGNI parseLit
silby ebef1a2
fixup: remaining multiline enclosures
silby 8664d8e
Handle middle delimiters (i.e. the pipe)
silby 35cd77b
Add middle punctuation tests from mandoc regress
silby f3b8fee
fixup: Spacing enclosures
silby 81504ea
Add Lk support for hyperlinks
silby ecbb1db
Add Mt macro
silby 309e864
Add .No test
silby 2f28750
Add Pa (path) macro
silby f921ba8
Add Fl, Ev, Cm and tests
silby 79c34c9
fixup Ev: Move test to the right section
silby 86af568
Refine Fl parser
silby 5a2196e
Extract helper for inline macros that produce Code
silby 162f48d
Zap useless comments
silby 2cf842d
Remove useless do
silby 91e1730
Add .Fl Fl support
silby 2a1688b
Add Ar macro
silby c9d1530
Add more easy macros
silby 9b63a48
Zap comment alluding to an abandoned helper
silby 8fe57d3
Add In macro (non-SYNOPSIS version)
silby dbf31cb
Ignore .Ns at start of line in mdoc lexer
silby b8b7411
Add Ap macro
silby f7d07be
Add a couple more easy codelike macros
silby 3464d9c
tktktk: Sm support
silby 3b74c82
Abandon whitespace-preservation in text lines
silby 681e1d3
Skip to the end of the SYNOPSIS for now
silby 9d956b8
Reformat
silby 7e0f712
Fix .Nm parsing and insertion of manual name
silby 638d84a
Skip unknown macros in block context
silby 6ed129f
Parse display blocks and 1-line literals
silby 2d94ad6
Move skipUnknownMacro to outer blocks
silby 2589dbb
Add Dv macro
silby 2147b2f
Add bullet, ordered, and definition lists
silby 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -522,6 +522,7 @@ library | |
split >= 0.2 && < 0.3, | ||
syb >= 0.1 && < 0.8, | ||
tagsoup >= 0.14.6 && < 0.15, | ||
template-haskell, | ||
temporary >= 1.1 && < 1.4, | ||
texmath >= 0.12.8.10 && < 0.13, | ||
text >= 1.1.1.0 && < 2.2, | ||
|
@@ -547,6 +548,7 @@ library | |
hs-source-dirs: src | ||
|
||
exposed-modules: Text.Pandoc, | ||
Text.Pandoc.Readers.Roff, | ||
Text.Pandoc.App, | ||
Text.Pandoc.Data, | ||
Text.Pandoc.Options, | ||
|
@@ -588,6 +590,8 @@ library | |
Text.Pandoc.Readers.EPUB, | ||
Text.Pandoc.Readers.Muse, | ||
Text.Pandoc.Readers.Man, | ||
Text.Pandoc.Readers.Mdoc, | ||
Text.Pandoc.Readers.Mdoc.Lex, | ||
Text.Pandoc.Readers.FB2, | ||
Text.Pandoc.Readers.DokuWiki, | ||
Text.Pandoc.Readers.Ipynb, | ||
|
@@ -699,6 +703,7 @@ library | |
Text.Pandoc.Readers.LaTeX.Parsing, | ||
Text.Pandoc.Readers.LaTeX.SIunitx, | ||
Text.Pandoc.Readers.LaTeX.Table, | ||
Text.Pandoc.Readers.Mdoc.Macros, | ||
Text.Pandoc.Readers.Typst.Parsing, | ||
Text.Pandoc.Readers.Typst.Math, | ||
Text.Pandoc.Readers.ODT.Base, | ||
|
@@ -721,8 +726,8 @@ library | |
Text.Pandoc.Readers.Org.ParserState, | ||
Text.Pandoc.Readers.Org.Parsing, | ||
Text.Pandoc.Readers.Org.Shared, | ||
Text.Pandoc.Readers.Roff.Escape, | ||
Text.Pandoc.Readers.Metadata, | ||
Text.Pandoc.Readers.Roff, | ||
Text.Pandoc.Writers.Docx.OpenXML, | ||
Text.Pandoc.Writers.Docx.StyleMap, | ||
Text.Pandoc.Writers.Docx.Table, | ||
|
@@ -822,6 +827,7 @@ test-suite test-pandoc | |
Tests.Readers.Muse | ||
Tests.Readers.Creole | ||
Tests.Readers.Man | ||
Tests.Readers.Mdoc | ||
Tests.Readers.FB2 | ||
Tests.Readers.DokuWiki | ||
Tests.Writers.Native | ||
|
@@ -858,3 +864,8 @@ benchmark benchmark-pandoc | |
deepseq | ||
-- we increase heap size to avoid benchmarking garbage collection: | ||
ghc-options: -rtsopts -with-rtsopts=-A8m -threaded | ||
|
||
executable lexroff | ||
import: common-executable | ||
main-is: lexroff.hs | ||
build-depends: pandoc, text | ||
Comment on lines
+867
to
+871
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Private test thingy, need to zap this. |
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
Oops, something went wrong.
Oops, something went wrong.
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.
exposed this for my
lexroff.hs
thing which I didn't commit, move back toother-modules
before merge