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

Only some kramdown options are supported #1095

Closed
justin808 opened this Issue May 13, 2013 · 7 comments

Comments

Projects
None yet
5 participants
@justin808
Copy link

justin808 commented May 13, 2013

Is there any reason that only a few of the Kramdown options are passed? I'm trying to use org-mode to generate jekyll pages via octopress, and I'm trying to make this org-mode syntax work. I need to insert markdown, as the link generation of org-mode cannot be used...So it's useful to allow passing some jekyll markdown from the org-mode conversion.

Here's a full description of how I have this setup. http://octopress.dev/blog/2013/04/27/octopress-setup-with-github-and-org-mode/

The only other option seems to be to use all absolute URLs, which is not idea.

    This link
    #+begin_html
    [Some link description](/blog/2013/05/11/blog-article/)
    #+end_html
    is very good...

Here is a snippet from markdown.rb, line 112 (and same exact code 129). The last option shown below is not in the code base.

        Kramdown::Document.new(content, {
          :auto_ids      => @config['kramdown']['auto_ids'],
          :footnote_nr   => @config['kramdown']['footnote_nr'],
          :entity_output => @config['kramdown']['entity_output'],
          :toc_levels    => @config['kramdown']['toc_levels'],
          :smart_quotes  => @config['kramdown']['smart_quotes'],
          :parse_block_html  => @config['kramdown']['parse_block_html'],

Here's the proposed _config.yml

markdown: kramdown
kramdown:
  parse_block_html: true # default for kramdown is false. This will enable using Markdown links

It might be worthwhile to pass all kramdown options so that when a new option is added to a markdown engine, the options are simply passed through to the markdown engine.

I can look into making this change, but I need to get employer approval before contributing to any open source project, which can be a very slow process.

@mattr-

This comment has been minimized.

Copy link
Member

mattr- commented May 13, 2013

I'm afraid that your octopress.dev link won't work since .dev is a local
only domain option provided by the pow tool (or some other custom setup).
Could you perhaps point us to a gist or something similar that we could
look at? Thanks! ❤️

On Mon, May 13, 2013 at 3:21 AM, Justin notifications@github.com wrote:

Is there any reason that only a few of the Kramdown options are passed.
Here is a snippet from markdown.rb, line 112 (and same exact code 129). I'm
trying to use org-mode to generate jekyll pages via octopress, and I'm
trying to make this org-mode syntax work. I need to insert markdown, as the
link generation of org-mode cannot be used...So it's useful to allow
passing some jekyll markdown from the org-mode conversion.

Here's a full description of how I have this setup.
http://octopress.dev/blog/2013/04/27/octopress-setup-with-github-and-org-mode/

The only other option seems to be to use all absolute URLs, which is not
idea.

This link
#+begin_html
[Some link description](/blog/2013/05/11/blog-article/)
#+end_html
is very good...

The last option shown below is not in the code base.

    Kramdown::Document.new(content, {
      :auto_ids      => @config['kramdown']['auto_ids'],
      :footnote_nr   => @config['kramdown']['footnote_nr'],
      :entity_output => @config['kramdown']['entity_output'],
      :toc_levels    => @config['kramdown']['toc_levels'],
      :smart_quotes  => @config['kramdown']['smart_quotes'],
      :parse_block_html  => @config['kramdown']['parse_block_html'],

It might be worthwhile to pass all kramdown options so that when a new
option is added to a markdown engine, the options are simply passed through
to the markdown engine.

I can look into making this change, but I need to get employer approval
before contributing to any open source project, which can be a very slow
process.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1095
.

@parkr

This comment has been minimized.

Copy link
Member

parkr commented May 13, 2013

So we could easily support all these options if we read everything in like this:

# in lib/jekyll/core_ext.rb
# :heart:-ly ripped from rails core extensions
class Hash
  def symbolize_keys!
    keys.each do |key|
      self[(key.to_sym rescue key) || key] = delete(key)
    end
    self
  end
  def symbolize_keys
    dup.symbolize_keys!
  end
end

# in lib/jekyll/converters/markdown/kramdown.rb
Kramdown::Document.new(content, @config["kramdown"].symbolize_keys)

Then you just specify your option and value under kramdown in your configs..

@justin808

This comment has been minimized.

Copy link
Author

justin808 commented May 13, 2013

My bad! http://www.railsonmaui.com/blog/2013/04/27/octopress-setup-with-github-and-org-mode/

You can view the source for this here: https://github.com/justin808/justin808.github.io

Thanks!

@parkr is what I'm thinking would be much better for all markdown modes.

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Jul 14, 2013

Fixed with merge of #1201. Thanks @zachgersch!

@parkr parkr closed this Jul 14, 2013

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Jul 14, 2013

Also note that only options Kramdown's HTML converter are supported. We only use that one converter so we can't support other options.

@HugoGiraudel

This comment has been minimized.

Copy link
Contributor

HugoGiraudel commented Jan 19, 2015

I am sorry to comment on such an old issue but it seemed like the most appropriate place to ask my question without opening a new issue.

We are currently in the process of translating http://sass-guidelin.es in several languages. Site runs on Jekyll, hosted on GitHub Pages, Kramdown as a Markdown parser of course.

We use auto IDs (option auto_ids) from Kramdown. Problem is non-latin characters are stripped. It doesn't cause any trouble for most cases, but languages not using the latin alphabet such as Russian get unusable IDs because all characters are stripped, leaving nothing but dashes (e.g. id="----").

Kramdown supports an option to convert non-latin characters into latin in order to preserve IDs usability: http://kramdown.gettalong.org/options.html#option-transliterated-header-ids.

I tried putting this configuration in my _config.yml, works fine locally (even with --safe or safe: true) but when pushing to GitHub Pages, I get a page build failure.

# Build settings
markdown: kramdown

kramdown:
    transliterated_header_ids: true

The page build failed with the following error:

Page build failed. For more information, see https://help.github.com/articles/troubleshooting-github-pages-build-failures.

If you have any questions please contact us at https://github.com/contact.

Any idea how to proceed perhaps?

@parkr

This comment has been minimized.

Copy link
Member

parkr commented Jan 19, 2015

Hey Hugo, no problem. For issues like this, write to support@github.com and they'll grab the error Jekyll throws. :)

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.