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

Find a library for parsing markdown files #3

Open
aoloe opened this issue Sep 24, 2013 · 7 comments
Open

Find a library for parsing markdown files #3

aoloe opened this issue Sep 24, 2013 · 7 comments

Comments

@aoloe
Copy link
Owner

aoloe commented Sep 24, 2013

If possible something qt based.

@aoloe
Copy link
Owner Author

aoloe commented Sep 25, 2013

@aoloe
Copy link
Owner Author

aoloe commented Oct 18, 2013

a -- simple -- sample parser implementation: http://www.qtcentre.org/threads/30707-Parse-Text-File-with-Qt

@aoloe
Copy link
Owner Author

aoloe commented Oct 18, 2013

@aoloe
Copy link
Owner Author

aoloe commented Oct 18, 2013

this is a good summary of the ways one can work on it:

http://stackoverflow.com/questions/605434/how-would-you-go-about-parsing-markdown

my conclusion is that it's probably best to split the file by line and then analyse each of them (or read the file one line at t time and then parse them)

@aoloe
Copy link
Owner Author

aoloe commented Oct 18, 2013

in the scribus code the about files look like markdown ones: http://scribus.net/svn/Scribus/trunk/Scribus/scribus/ui/about.cpp

@aoloe
Copy link
Owner Author

aoloe commented Oct 19, 2013

qlalr allows to parse a file based on a formal grammar (http://en.wikipedia.org/wiki/LALR_parser)

the main idea is:

  • you write a grammar
  • run the grammar file through qlalr to generate c++ files
  • include the generated .h files in your code
  • extend the table class and get it to parse the files.

reading http://www.cforcoding.com/2010/01/markdown-and-introduction-to-parsing.html seems to show that markdown not being context free, it's hard to create a context free grammar for it.

@aoloe
Copy link
Owner Author

aoloe commented Oct 19, 2013

a peg parser may be a better idea:

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

No branches or pull requests

1 participant