Skip to content
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] Add Muse reader #3620

Merged
merged 5 commits into from
Jun 19, 2017
Merged

[WIP] Add Muse reader #3620

merged 5 commits into from
Jun 19, 2017

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Apr 30, 2017

I have created a basic Muse reader. It supports headings, inline markup and footnotes, but no tables and lists. It is far from full markup support, but it satisfies my needs so I plan to continue development slowly from now on. Hope it gets merged.

@jgm
Copy link
Owner

jgm commented Apr 30, 2017

I'd rather not merge until this has support for tables and lists.

@link2xt link2xt changed the title Add Muse reader [WIP] Add Muse reader Apr 30, 2017
@link2xt
Copy link
Collaborator Author

link2xt commented Apr 30, 2017

@jgm Ok, will make them high priority then.

@link2xt link2xt force-pushed the muse-reader branch 2 times, most recently from 02705ba to b9c1740 Compare April 30, 2017 23:16
@tarleb
Copy link
Collaborator

tarleb commented May 1, 2017

Regarding tables: My understanding is that Muse supports tables.el and org tables (plus a third style). The org reader should be able to read tables.el formatted tables as well (#3314). It seems to me that a simple way to do this would be to extract the grid table parser from the markdown reader into a separate module. Same for the org table parser. @jgm, would you be okay with a separate Table module, collecting all (shared) table parsers?

@jgm
Copy link
Owner

jgm commented May 1, 2017 via email

@tarleb
Copy link
Collaborator

tarleb commented May 2, 2017

Text.Pandoc.Parsing already contains gridTableWith. Can you just use that?

Ah, yes. I had missed that.

I generalized the signature of tableWith to

tableWith :: (Stream s m Char, HasReaderOptions st, Monad mf)
          => ParserT s st m (mf [Blocks], [Alignment], [Int])
          -> ([Int] -> ParserT s st m (mf [Blocks]))
          -> ParserT s st m sep
          -> ParserT s st m end
          -> ParserT s st m (mf Blocks)

i.e. the state is no longer fixed to ParserState and table-cell block parsers must return values wrapped in a monad. This requires a bit of Identity wrapping and unwrapping in the RST reader, but seems to work well.

@jgm
Copy link
Owner

jgm commented May 3, 2017 via email

@tarleb
Copy link
Collaborator

tarleb commented May 3, 2017

I pushed the changes and can take a look into merging the Markdown-specific gridTable parser into the generic parser.

@link2xt link2xt force-pushed the muse-reader branch 4 times, most recently from c29b6be to 55b6afa Compare May 12, 2017 00:42
@link2xt link2xt force-pushed the muse-reader branch 2 times, most recently from 9d495f7 to d9ee633 Compare May 13, 2017 13:28
@link2xt
Copy link
Collaborator Author

link2xt commented May 13, 2017

Added tables support. It is aimed to be compatible with Emacs Muse, not Text::Amuse, as Text::Amuse differences are considered a bug: melmothx/text-amuse#14

For example, tables are not required to be indented with a space, although writer indents them now for compatibility with Text::Amuse #3649.

@link2xt link2xt force-pushed the muse-reader branch 4 times, most recently from 673418d to 006eff1 Compare May 18, 2017 12:07
@link2xt link2xt closed this May 28, 2017
@link2xt link2xt deleted the muse-reader branch May 28, 2017 01:40
@link2xt link2xt reopened this May 28, 2017
@link2xt link2xt force-pushed the muse-reader branch 3 times, most recently from 8f5c1c5 to e88b895 Compare May 28, 2017 16:04
@link2xt link2xt force-pushed the muse-reader branch 15 times, most recently from 2409c3e to a20fc38 Compare June 18, 2017 14:09
@link2xt
Copy link
Collaborator Author

link2xt commented Jun 18, 2017

@jgm Tables and lists are now supported. I rebased against master and removed all hlint warnings. No definition lists and Org tables (A Muse Wiki does not support them either, though) yet.

@jgm jgm merged commit a91b9b2 into jgm:master Jun 19, 2017
@jgm
Copy link
Owner

jgm commented Jun 19, 2017

Great, thanks!

@melmothx
Copy link

melmothx commented Aug 3, 2017

Text::Amuse does support definition lists https://amusewiki.org/library/manual#toc16 (documented since February 2016).

https://amusewiki.org/git/amw/commit/m/ml/manual.muse?id=73579f4c26aa047742cb319f3661a203b2fc7eb7

@link2xt
Copy link
Collaborator Author

link2xt commented Aug 3, 2017

@melmothx "A Muse Wiki does not support them either, though" was related to Org tables only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants