-
Notifications
You must be signed in to change notification settings - Fork 197
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
Mistletoe bugs and questions #24
Comments
Another question - in our example rST file, we have this role:
How would this be accomplished in myst? Something like
? |
seems that directive nesting is a bit finnicky sometimes - the following code doesn't produce proper output for me:
This is also throwing the following warning:
so it sounds like it's treating it as a raw
block |
Labels and other syntax that doesn't exist in rST? Something else I wanted to do when trying out the roles syntax was using a
However, I don't believe anything like |
Another piece of syntax that doesn't exist in markdown: comments. Perhaps we want some kind of comment syntax to tell the parser to skip things? Generally people use HTML comments to do this, but I feel like we don't want to encourage that... |
Ermm yeh it just has to be correct YAML lol, as in
You control it by the number of backslashes, each block has to have a different number, with the most on the outside, i.e. `````{outer}
The next info should be nested
````{inner}
Here's my warning
```{more inner}
```
````
````` But obviously the option to indent would be ideal.
No it doesn't, I've put a few 'todos' for syntax extensions, primarily targets (i.e. labels), comments (as you say, preferably not just the HTML type ones), and field lists (e.g. so you can use the sphinx |
Just |
Nice - lemme note a few more points. I'm discovering these as I'm writing up some docs about this spec here: https://github.com/ExecutableBookProject/markup_test_cases/ Multi-part rolesHow would multi-part roles be handled here? E.g. Code nestingYour point about outer-fences being longer than inner seemed to work! That said I am still getting a weird warning about Non-kwarg parametersIt's also possible to pass non-kwarg parameters to a directive (e.g. https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive:option-code-block-linenos), which I believe currently doesn't work. EDIT: Ah I see this is what you mean by field lists above, yeah? roles link syntax
Why would this work? Isn't that Error reportingI'm noticing that when I get errors, the reporting chain breaks down and I get this error-error:
Newlines and paragraph breaksI noticed that breaks in the markup will cause line breaks in the output...maybe this is default markdown behavior? |
Firstly, make sure you update your fork, because I did some updates to ensure tests pass, and also added table parsing. At the bottom of test_docutils_renderer you'll see that I run a test for all of the docutils/sphinx roles/directives (against sphinx_directives.json and sphinx_roles.json). In these tests you can see that I skip a few roles/directives currently that for whatever reason aren't working, must most pass, including multi-part roles.
If you can give me the exact example of what is failing, I can check
You would just use
Becuse you don't have to have RST/Markdown syntax within the role content. The role function interprets that string however it wants. Just now if it calls a 'nested parse' on all or part of the string, it would be evaluated as Markdown, rather than RST. In the case of the
That is now fixed, see here
No I don't think it should, I'll look into it |
From the commonmark discussions, it looks like comment blocks would be best to start with
|
HTML comments can still be seen in |
@chrisjsewell I think that if there is anything close to consensus elsewhere in markdownland, we should just use that 👍 |
We can probably move this discussion to For paragraph breaks, the markdown spec is actually that there are soft breaks (no space after) and hard breaks (2+ spaces or Hello (<-- two spaces)
World I recall @jstac saying about this before. Before I was treating these equally: def render_line_break(self, token):
self.current_node.append(nodes.raw("", "<br />", format="html")) I've now improved that with: def render_line_break(self, token):
if token.soft:
self.current_node.append(nodes.Text('\n'))
else:
self.current_node.append(nodes.raw("", "<br />", format="html")) |
Also you can indent nested directives, but the indentation (for each nesting level) has to be less than 4, otherwise it is treated as a standard code block:
e.g.
|
@chrisjsewell I agree - really fantastic work on spot-checking these. I will go through any outstanding points here and open a new issue in the new repo, and will then close this issue |
% a comment goes to this: <comment xml:space="preserve">
a comment and is omitted from HTML |
Open to syntax suggestions, but I though the |
Nice - I just added it in the docs to #7 We can take a pass through syntax maybe tomorrow or something. This seems reasonable but I guess the main question is whether something like this exists in pandoc already. |
Yeh sure ting, to my knowledge there's no 'target' like syntax/functionality in Commonmark/pandoc, it is a purely RST construct |
I'm just playing around with mistletoe, and since your fork doesn't allow issues (forks generally don't) I'll put code-specific comments here.
First thing I found: sometimes you want to have colons in arguments. For example in the default sphinx toctree directive it has
:caption: Contents:
. Doing this with myst results in this error:The text was updated successfully, but these errors were encountered: