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

Periods should be allowed in HEADER_ID and ALD_TYPE_ID_NAME #303

Closed
cabo opened this issue Jan 30, 2016 · 7 comments
Closed

Periods should be allowed in HEADER_ID and ALD_TYPE_ID_NAME #303

cabo opened this issue Jan 30, 2016 · 7 comments
Assignees
Milestone

Comments

@cabo
Copy link
Contributor

cabo commented Jan 30, 2016

There is a longstanding tradition to allow periods in names that are turned into XML IDs, just as are colons and hyphens.
This is probably hard to do in ALD_TYPE_ID_NAME (conflict with class name syntax). (Should there be a way to escape a period or maybe any other character going into an ID name? Maybe not, as this always can be phrased as "id=...".)
Conversely, it seems trivial to allow periods in HEADER_ID.

@gettalong gettalong added this to the 2.0.0 milestone Feb 18, 2016
@gettalong gettalong self-assigned this Feb 18, 2016
@gettalong
Copy link
Owner

As you have pointed out, in ALD_TYPE_ID_NAME it is not easily possible but in HEADER_ID it is.

However, I will defer this to the next major version.

@aoles
Copy link

aoles commented Sep 26, 2016

Dear Thomas,

the lack of periods in header IDs causes the following incompatibility issue of pandoc-generated markdown files which serve as input to the nanoc site generator, which in turn uses kramdown to convert them to html.

Kramdown documentation says: The rules on how header text is converted to an identifier are based on the rules specified by Pandoc. However, kramdown's rules differ in the way periods are handled: while they are retained by pandoc, kramdown removes them.

The problem appears when I use pandoc to generate a TOC. When I convert a file containing

# A. Header

with the command pandoc header.md --to markdown_strict --from markdown --standalone --table-of-contents I get

-   [A. Header](#a.-header)

A. Header
=========

But once the file is rendered to html by kramdown, the auto-generated hyperlink is incorrect as the kramdown header id is a-header, and not a.-header.

Do you think this could be addressed soon?

Thanks,
Andrzej

@gettalong
Copy link
Owner

@aoles As written this can only be addressed in the next major release since it would invalidate quite many currently working documents.

The problem is that you are trying to use two different Markdown libraries which will not work in most cases anyway.

kramdown does provide a table of contents feature for the HTML converter, see http://kramdown.gettalong.org/converter/html.html#toc. So there is no need to use another tool for this.

@aoles
Copy link

aoles commented Sep 27, 2016

Thank you @gettalong for your quick response and for pointing out to me the kramdown TOC feature! This is very helpful, I will most probably switch to it in my workflow.

Just some background information why I need to use both pandoc and kramdown: My specific use case involves the creation of pages for a website compiled with nanoc. These are generated from .Rmd documents, which contain R code chunks evaluated during compilation; the output is then further processed with pandoc. The final html version is generated by kramdown from the resulting .md document. That's why it's important to me that pandoc mardown is compatible with kramdown.

Thanks for all your work on kramdown - I'm looking forward to the upcoming release.

Cheers,
Andrzej

aoles added a commit to Bioconductor/BiocStyle that referenced this issue Sep 27, 2016
- 'md_document()': use kramdown functionality to generate TOC (see gettalong/kramdown#303)
@gettalong
Copy link
Owner

@aoles Note that the upcoming releases won't have this change in them since this change will only be incorporated into the 2.x release.

I still don't fully understand why you need two Markdown processors. If you already use Pandoc, than just use the HTML that Pandoc generates. Otherwise use only kramdown. Using two different Markdown converters and expecting complete feature parity is not going to work for most Markdown converter pairings.

@aoles
Copy link

aoles commented Sep 27, 2016

@gettalong thanks for clarifying!

I use this 2-step approach because I need intermediate output containing document body which gets rendered within the website template by nanoc. Sure, it would be also possible to generate HTML output in first place - for this I would probably just need to use a custom stripped-down pandoc template. I will certainly consider this as an alternative if things don't work out with the current approach. Anyway, thanks for your help!

Cheers,
Andrzej

aoles pushed a commit to Bioconductor/BiocStyle that referenced this issue Oct 19, 2016
- 'md_document()': use kramdown functionality to generate TOC (see gettalong/kramdown#303)

From: aoles <andrzej.oles@gmail.com>

git-svn-id: https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/BiocStyle@121437 bc3139a8-67e5-0310-9ffc-ced21a209358
@gettalong
Copy link
Owner

Closed because feature request issues are now tracked through a dedicated project - see https://github.com/gettalong/kramdown/projects/1

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

3 participants