kramdown

Table of contents using Jekyll and Kramdown

房东的猫 提交于 2019-12-21 03:43:25
问题 I'm trying to use Kramdown's auto "Table of Contents" generator on a page (not a post) on my Jekyll site. _includes/toc.html <nav> <h4>Table of Contents</h4> {:toc} </nav> my_cool_stuff/my_cool_page.md --- layout: page --- {% include toc.html %} # The title of my page ## The Subtitle of my page The HTML is generated literally and I'm not getting a list of headers. <nav> <h4 class="toc_title">On This Page</h4> {:toc} </nav> What am I setting up wrong? 回答1: {:toc} is kramdown tag for automatic

Tilt (kramdown) preventing ERB processing when rendering markdown

只愿长相守 提交于 2019-12-20 04:51:48
问题 I am building a website with Middleman. I am storing a lot of information in data files, as I am going to use the same information on multiple pages. (Partials wouldn't work for me, as same text from data can be used with different HTML tags or be slightly modified for different pages.) I want to write markdown in data files and then use it within HAML templates for specific pages. When I try to create relative links to other pages while using a reference to other data file, resulting HTML is

How to make markdown text align justify

只愿长相守 提交于 2019-12-14 01:58:26
问题 I use this <p align="justify"> Some plain texts will be aligned justify </p> It is really awesome when I just have plain text. However, if I would like to justify something like this, it does not work correctly. The url and list will disappear. [Lorem ipsum dolor sit amet](some-awesome-webpage), consectetur adipisicing elit, sed do eiusmod - tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, - quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo -

Background highlight text in a code block?

不问归期 提交于 2019-12-12 12:13:14
问题 My goal is to be able to display something like this: I want to background highlight a piece of code inside a code block that already has syntax highlighting . I want to do this on a markdown file I have on Github that is hosted on Github Pages (can use kramdown markdown, html, css). I am aware that you can have syntax highlighting inside a code block doing something like this: ```java int foo (void) { int i; } ``` I am also aware that I can background highlight text inside a code block by

markdown display incorrect when add code block in list

半世苍凉 提交于 2019-12-11 12:24:14
问题 I am using pygments and kramdown in my jekyll blog. I tried to add code block to markdown list, but display incorrect. 1. first 2. second {% highlight ruby %} def foo puts 'foo' end {% endhighlight %} 3. third generated html: <ol> <li> <p>first</p> </li> <li> <p>second</p> </li> </ol> <div class="highlight"><pre><code class="language-ruby" data-lang="ruby"><span class="k">def</span> <span class="nf">foo</span> <span class="nb">puts</span> <span class="s1">'foo'</span> <span class="k">end<

Jekyll Kramdown T.O.C. not building

别说谁变了你拦得住时间么 提交于 2019-12-11 08:04:58
问题 Here's the final output of what I'd like to have: <article itemscope itemtype="http://schema.org/BlogPosting"> <header> <h1>Jekyll Table of Contents with Kramdown </h1> </header> <nav aria-label="Table of Contents"> <ul> <li>Topic 1</li> <li>Topic 2</li> <li>Topic 3</li> </ul> <nav> <section itemprop="articleBody"> <p>the main body of the article</p> </section> </article> With a default Jekyll install Kramdown can create a TOC with * TOC {:toc} However Markdown is not currently supported in

Jekyll: Cannot render YAML front matter field as markdown correctly

依然范特西╮ 提交于 2019-12-10 18:16:52
问题 I am building the pages in my site with a list of nodes in the YAML front matter, like so: --- title: My page layout: default nodes: - header: Node header text_block: > This is supposed to be markdown. [This works](http://example.com) But: - this - doesn't - work --- And then: {% for node in page.nodes %} {{ node.text_block | markdownify }} {% endfor %} In the above example, the text_block will be rendered like this: This is supposed to be markdown. This works But: - this - doesn't - work The

Jekyll link within page

 ̄綄美尐妖づ 提交于 2019-12-10 13:00:07
问题 I'm using Jekyll on Github, and I wonder whether there's a way to link to a section within a page. Say I have a section like ## Section 1 ## section content and later in the same page I want to link to this section. I've found how to link to another page within the blog and do footnotes, but not this. As a note, I use markdown: kramdown in my _config.yml 回答1: kramdown supports the automatic generation of header IDs if the option auto_ids is set to true (which is the default). This is done by

Retain HTML Entities When Parsing Markdown

一个人想着一个人 提交于 2019-12-10 11:32:28
问题 I have exhausted my research and tried many methods to no effect and am hoping I'm overlooking some kind of simple solution: I am using a Jekyll site to produce HTML files for e-mail and need to use HTML entities for special characters (such as em-dashes and smart quotes) in order to avoid improper symbol interpretation (the content-type/charset is at times stripped out of the e-mail head due to complexities I won't get into here.) My problem is that parsing my Markdown appears to convert all

Fenced codeblocks in Jekyll

老子叫甜甜 提交于 2019-12-08 17:56:26
I have just upgraded my local Jekyll installation to Jekyll 3.0.2. I was looking forward to use fenced (backticks) code blocks when posting source code. This however doesn't work, and I still have to use Liquid tags to specify codeblocks My build settings in _config.yml: baseurl: / destination: _site permalink: pretty markdown: kramdown kramdown: input: GFM syntax_highlighter: rouge List of Ruby gems installed activesupport (4.2.5.1) addressable (2.3.8) bigdecimal (1.2.6) bundler (1.11.2) coffee-script (2.4.1) coffee-script-source (1.10.0) colorator (0.1) ethon (0.8.1) execjs (2.6.0) faraday