-
-
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
Implemented #168 #3670
Implemented #168 #3670
Conversation
First time it compiled .. better test it first, though..
Better test it before shipping :) (see last commit-msg ;) ) Implements jgm#168 with bird-tracks: ; --- div {.foo} ; Lorem ipsum dolor sit amet, consectetur adipiscing ; elit, sed do eiusmod tempor incididunt ut labore et ; dolore magna aliqua. Ut enim ad minim veniam. and with block-syntax: ; --- div {.foo} Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam. ; --- Nesting is also supported. It was not tested if this will break other things but it should not.
(failed travis-check is due to timeout during compilation on their end for 2 of 4 vms) |
@jgm anything that is missing or i overlooked before this could be merged? I am willing to invest some hours into this to get things released as soon and as smooth as possible ;) Would the writer have to be updated as well to generate the corresponding md? so that |
@Drezil It's great to have some working code to play around with and see how the syntax feels like to work with on real documents, however I guess this won't be merged until a syntax is decided for good... (uvtc's syntax was only a proposal and unfortunately the discussion seems to have stalled a bit) |
The discussion seems to have stalled for nearly 6 years now ;) I argue that we need the feature with any syntax. In my case i want to create slides via reveal-js and there you can do amazing things with divs + css-classes (like multi-column, triggers, ...). Put a good filter on top of it and you can customize the syntax as you like. Problem at the Moment is that there was previously no way to create a Block-Element with Attributes (as Div is the only one), as this AST-Element never gets created in the markdown-parser. Classify it as experimental or i can move it to an optional extension (like markdown+div) or so - i just think that we need (at least one) way to generate every element in the AST for filters & interop.. |
you could always use the HTML div syntax which the markdown-reader parses as a native pandoc div. btw, I agree that it would be great to decide on a definitive div syntax, but that's up to @jgm... |
Using HTML syntax in markdown works for this: <div id="foo" class="bar">
# Slide
Wassup?
</div> This will wrap the elements in a div the AST as long as the markdown_in_html extension is enabled (which it is per default). EDIT: mb21 was faster 😄 |
I don't quite follow. For me, the above results in
when read as pandoc markdown. Isn't that what you mean? |
Oh, i was not aware that this is the supposed syntax for creating AST-divs in pandoc-markdown as it is plain html and nothing "markdown-y". One thing that bothers me is that this adds redundancy for the attribute-syntax With that knowledge the PR is for me personally from "urgent" down to "would be nice to have it soon". |
Indeed, and that's why it has been "soon" for 6 years now.. |
Would it be ok to merge this as an extension? I could rewrite it so that "soon" is not another 6 years... :/ Another small thing for http://pandoc.org/MANUAL.html#non-pandoc-extensions probably? |
You picked one of the many syntax ideas in that thread. I'm not sure why you picked that one, but I myself wouldn't favor any syntax that makes you write I think there are also some potential syntax issues, assuming we allow "laziness" for the side-marked version (which we probably should since blockquotes allow it). With laziness,
by itself is equivalent to
But then that creates a kind of ambiguity in cases like
Anyway, this isn't the place for discussion of the syntax; that should take place on the issue itself. I'm just explaining why I'm not keen to merge this at this point, even as an extension. |
I should also add that tests of the new feature would be a necessity before I'd even consider merging a PR like this. (I'm not saying to add tests, though, because as mentioned above I have too many reservations about the syntax you're implementing.) |
- added attributes so side-tracked syntax - added test-cases
I'm closing this, as a different syntax has been chosen; #168 is closed. |
This PR implements #168 as described in #168 (comment)
It should work for normal and nested blocks with both syntaxes described.
There are no tests yet, as i don't know how you want them implemented properly.
A
stack test
shows that it should not break other things:All 968 tests passed (81.94s)