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

Explain in README how to use custom templates #73

Closed
mojavelinux opened this issue May 28, 2016 · 1 comment
Closed

Explain in README how to use custom templates #73

mojavelinux opened this issue May 28, 2016 · 1 comment
Assignees
Milestone

Comments

@mojavelinux
Copy link
Member

Explain how to use custom templates for generating HTML output from AsciiDoc. Here are the requirements:

  • Add additional gems (the gem for the template engine as well as the thread_safe gem)
  • Create the _templates directory in the project root
  • Add at least one template to the _templates directory
  • Enable the template_dir option in the Asciidoctor configuration in _config.yml
@mojavelinux
Copy link
Member Author

Here are the steps.

Step 1: Add additional gems to the Gemfile

gem 'slim', '~> 3.0.7'
gem 'thread_safe', '~> 0.3.5'

Step 2: Run Bundler

$ bundle

Step 3: Create a folder for templates named _templates

$ mkdir _templates

Step 4: Add a template to the _templates folder (ulist.html.slim)

- if title?
  figure.list.unordered id=id
    figcaption=title
    ul class=[style, role]
      - items.each do |_item|
        li
          span.primary=_item.text
          - if _item.blocks?
            =_item.content
- else
  ul id=id class=[style, role]
    - items.each do |_item|
      li
        span.primary=_item.text
        - if _item.blocks?
          =_item.content

Step 5: Configure Asciidoctor in _config.yml to use templates

asciidoctor:
  template_dir: _templates
  attributes:
    ...

mojavelinux added a commit to mojavelinux/jekyll-asciidoc that referenced this issue Jun 12, 2016
@mojavelinux mojavelinux added this to the v1.2.0 milestone Jun 12, 2016
mojavelinux added a commit to mojavelinux/jekyll-asciidoc that referenced this issue Jun 13, 2016
mojavelinux added a commit to mojavelinux/jekyll-asciidoc that referenced this issue Jun 13, 2016
mojavelinux added a commit to mojavelinux/jekyll-asciidoc that referenced this issue Jun 13, 2016
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

1 participant