Awestruct with Markdown -- can't seem to get the sitewide settings to work, and no ToC or default layout

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Awestruct with Markdown -- can't seem to get the sitewide settings to work, and no ToC or default layout

Victor Danilchenko

I have my site compiled using AsciiDoctor, and the following settings in _config/site.yaml set the default behaviors, so that I don’t have to set them one by one:

 

asciidoctor:

  :safe: safe

  :interpolate: true

  :attributes:

    sitename: Cimpress AsciiDoctor docs

    interpolate: true

    toc: right

    name: FooNameAdoc

(etc.)

 

However, when I try to do the same in the ‘markdown:’ section, it gets summarily ignored. I can include such parameters in an .md document via front matter, but I can’t seem to be able to set them side-wide:

 

markdown:

  :safe: safe

  :interpolate: true

  :attributes:

    sitename: Cimpress Markdown docs

    interpolate: true

    toc: right

    name: FooNameMd

       (etc.)

 

Any idea what I am doing wrong?

 

Also, when I specify ‘toc: right’ in the front matter, it’s getting ignored – Awestruct generates HTML, but without TOC. My front matter does get processed, but apparently not the ‘toc’ flag. Is ToC supported for Markdown, and if so, what should I do to enable it? This might be related to the next question…

 

Finally, when I compile an .adoc file, if I don’t specify a layout, it receive a default fairly nice layout for the document (the only actual layout file in my _layouts directory is base.html.haml, and it’s not the one being used); but my .md files are compiled into ugly raw HTML without even document header/body/etc. tags – just raw HTML snippets. Is there something I am missing here?

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Awestruct with Markdown -- can't seem to get the sitewide settings to work, and no ToC or default layout

Victor Danilchenko

Oh yes, I am using Awestruct 5.5 with Ruby 2.1.2 on an Ubuntu Trusty system.

 

 

 

From: Victor Danilchenko
Sent: Wednesday, August 19, 2015 12:25 PM
To: [hidden email]
Subject: [awestruct] Awestruct with Markdown -- can't seem to get the sitewide settings to work, and no ToC or default layout

 

I have my site compiled using AsciiDoctor, and the following settings in _config/site.yaml set the default behaviors, so that I don’t have to set them one by one:

 

asciidoctor:

  :safe: safe

  :interpolate: true

  :attributes:

    sitename: Cimpress AsciiDoctor docs

    interpolate: true

    toc: right

    name: FooNameAdoc

(etc.)

 

However, when I try to do the same in the ‘markdown:’ section, it gets summarily ignored. I can include such parameters in an .md document via front matter, but I can’t seem to be able to set them side-wide:

 

markdown:

  :safe: safe

  :interpolate: true

  :attributes:

    sitename: Cimpress Markdown docs

    interpolate: true

    toc: right

    name: FooNameMd

       (etc.)

 

Any idea what I am doing wrong?

 

Also, when I specify ‘toc: right’ in the front matter, it’s getting ignored – Awestruct generates HTML, but without TOC. My front matter does get processed, but apparently not the ‘toc’ flag. Is ToC supported for Markdown, and if so, what should I do to enable it? This might be related to the next question…

 

Finally, when I compile an .adoc file, if I don’t specify a layout, it receive a default fairly nice layout for the document (the only actual layout file in my _layouts directory is base.html.haml, and it’s not the one being used); but my .md files are compiled into ugly raw HTML without even document header/body/etc. tags – just raw HTML snippets. Is there something I am missing here?

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Awestruct with Markdown -- can't seem to get the sitewide settings to work, and no ToC or default layout

Victor Danilchenko
In reply to this post by Victor Danilchenko

Any suggestions on what I am doing wrong with settings in site.yaml? Anyone?

 

 

From: Victor Danilchenko
Sent: Wednesday, August 19, 2015 12:25 PM
To: [hidden email]
Subject: [awestruct] Awestruct with Markdown -- can't seem to get the sitewide settings to work, and no ToC or default layout

 

I have my site compiled using AsciiDoctor, and the following settings in _config/site.yaml set the default behaviors, so that I don’t have to set them one by one:

 

asciidoctor:

  :safe: safe

  :interpolate: true

  :attributes:

    sitename: Cimpress AsciiDoctor docs

    interpolate: true

    toc: right

    name: FooNameAdoc

(etc.)

 

However, when I try to do the same in the ‘markdown:’ section, it gets summarily ignored. I can include such parameters in an .md document via front matter, but I can’t seem to be able to set them side-wide:

 

markdown:

  :safe: safe

  :interpolate: true

  :attributes:

    sitename: Cimpress Markdown docs

    interpolate: true

    toc: right

    name: FooNameMd

       (etc.)

 

Any idea what I am doing wrong?

 

Also, when I specify ‘toc: right’ in the front matter, it’s getting ignored – Awestruct generates HTML, but without TOC. My front matter does get processed, but apparently not the ‘toc’ flag. Is ToC supported for Markdown, and if so, what should I do to enable it? This might be related to the next question…

 

Finally, when I compile an .adoc file, if I don’t specify a layout, it receive a default fairly nice layout for the document (the only actual layout file in my _layouts directory is base.html.haml, and it’s not the one being used); but my .md files are compiled into ugly raw HTML without even document header/body/etc. tags – just raw HTML snippets. Is there something I am missing here?

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Awestruct with Markdown -- can't seem to get the sitewide settings to work, and no ToC or default layout

Victor Danilchenko
In reply to this post by Victor Danilchenko

BTW, it looks like Redcarpet has some support for ToC generation, but I can’t figure out how to determine which keys and values can go into the ‘:attributes:’ hash of the ‘redcarpet’ section in site.yaml.

 

In general, what determines which flags can be listed in attributed? Is it the module’s base class constructor parameters, or some sort of Awestruct translation map that maps attributes to engine features, or something else entirely?

 

 

From: Victor Danilchenko
Sent: Friday, August 21, 2015 11:04 AM
To: 'Jason Porter' <[hidden email]>
Subject: RE: [awestruct] Awestruct with Markdown -- can't seem to get the sitewide settings to work, and no ToC or default layout

 

Hmmmm, no, I didn’t see the response on the list… weird. It must have been filtered out. Thank you very much for responding to me.

 

I tried both Redcarpet and Kramdown. I didn’t explicitly configure them, just installed one or the other – Awestruct seems to have picked them up automatically. If I wanted to use another Markdown engine (say, I find one that supports ToC generation), how would I go about specifying for Awestruct which Markdown engine to use?

 

I did try renaming the ‘markdown’ section to ‘kramdown’, just as a wild shot, but it had no effect. However, based on what you are saying, it sounds like I simply need to use the correct Kramdown options, rather than AsciiDoctor options.

 

The Awestruct options are the ones beginning with ‘:’, right? And the specific engine’s options are the ones in the :attributes: hash?

 

Finally, am I correct in understanding you that there’s no way to specify Markdown page layout in site.yaml, but rather only via front matter?

 

From: Jason Porter [[hidden email]]
Sent: Friday, August 21, 2015 10:35 AM
To: Victor Danilchenko <
[hidden email]>
Subject: Fwd: [awestruct] Awestruct with Markdown -- can't seem to get the sitewide settings to work, and no ToC or default layout

 

Not sure if you saw this response to the list.

 

Also some more info would be good. Which gems are you using,?

---------- Forwarded message ----------
From: Jason Porter <[hidden email]>
Date: Wednesday, August 19, 2015
Subject: [awestruct] Awestruct with Markdown -- can't seem to get the sitewide settings to work, and no ToC or default layout
To: "[hidden email]" <[hidden email]>


Inline

On Wednesday, August 19, 2015, Victor Danilchenko <<a href="javascript:_e(%7B%7D,'cvml','vdanilchenko@cimpress.com');" target="_blank">vdanilchenko@...> wrote:

I have my site compiled using AsciiDoctor, and the following settings in _config/site.yaml set the default behaviors, so that I don’t have to set them one by one:

 

asciidoctor:

  :safe: safe

  :interpolate: true

  :attributes:

    sitename: Cimpress AsciiDoctor docs

    interpolate: true

    toc: right

    name: FooNameAdoc

(etc.)

 

However, when I try to do the same in the ‘markdown:’ section, it gets summarily ignored. I can include such parameters in an .md document via front matter, but I can’t seem to be able to set them side-wide:

 

markdown:

  :safe: safe

  :interpolate: true

  :attributes:

    sitename: Cimpress Markdown docs

    interpolate: true

    toc: right

    name: FooNameMd

       (etc.)

 

Any idea what I am doing wrong?

These settings depend on what engine you're using, they're not awestruct options. The name must also be the name of the engine being used like kramdown for example. Most of those options you have listed are asciidoc options.

 

Also, when I specify ‘toc: right’ in the front matter, it’s getting ignored – Awestruct generates HTML, but without TOC. My front matter does get processed, but apparently not the ‘toc’ flag. Is ToC supported for Markdown, and if so, what should I do to enable it? This might be related to the next question…

I don't know of a markdown engine that supports a toc. 

 

Finally, when I compile an .adoc file, if I don’t specify a layout, it receive a default fairly nice layout for the document (the only actual layout file in my _layouts directory is base.html.haml, and it’s not the one being used); but my .md files are compiled into ugly raw HTML without even document header/body/etc. tags – just raw HTML snippets. Is there something I am missing here? 

You need to add a layout to the frontmatter of each file. 



--
Sent from Gmail Mobile



--
Sent from Gmail Mobile

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Awestruct with Markdown -- can't seem to get the sitewide settings to work, and no ToC or default layout

LightGuard
Administrator
Here's an excerpt from a site I'm working on, maybe it'll help

````
kramdown:
  :input: 'QuickStartParser'
asciidoctor:
  :attributes:
    sectanchors: ''
slim|html:
  :format: :html
slim:
  :attr_list_delims:
    '(': ')'
    '[': ']'
```

Here we have settings for kramdown (the input attribute), asciidoctor, slim globally and slim for html. You can see how they're used in https://github.com/awestruct/awestruct/blob/master/lib/awestruct/handlers/base_tilt_handler.rb#L87-L123 which is used in https://github.com/awestruct/awestruct/blob/master/lib/awestruct/handlers/base_tilt_handler.rb#L131 to pass to Tilt, which passes them to the actual rendering agent.

Let me know if that doesn't help or if you need something more specific.

On Fri, Aug 21, 2015 at 9:14 AM, Victor Danilchenko <[hidden email]> wrote:

BTW, it looks like Redcarpet has some support for ToC generation, but I can’t figure out how to determine which keys and values can go into the ‘:attributes:’ hash of the ‘redcarpet’ section in site.yaml.

 

In general, what determines which flags can be listed in attributed? Is it the module’s base class constructor parameters, or some sort of Awestruct translation map that maps attributes to engine features, or something else entirely?

 

 

From: Victor Danilchenko
Sent: Friday, August 21, 2015 11:04 AM
To: 'Jason Porter' <[hidden email]>
Subject: RE: [awestruct] Awestruct with Markdown -- can't seem to get the sitewide settings to work, and no ToC or default layout

 

Hmmmm, no, I didn’t see the response on the list… weird. It must have been filtered out. Thank you very much for responding to me.

 

I tried both Redcarpet and Kramdown. I didn’t explicitly configure them, just installed one or the other – Awestruct seems to have picked them up automatically. If I wanted to use another Markdown engine (say, I find one that supports ToC generation), how would I go about specifying for Awestruct which Markdown engine to use?

 

I did try renaming the ‘markdown’ section to ‘kramdown’, just as a wild shot, but it had no effect. However, based on what you are saying, it sounds like I simply need to use the correct Kramdown options, rather than AsciiDoctor options.

 

The Awestruct options are the ones beginning with ‘:’, right? And the specific engine’s options are the ones in the :attributes: hash?

 

Finally, am I correct in understanding you that there’s no way to specify Markdown page layout in site.yaml, but rather only via front matter?

 

From: Jason Porter [[hidden email]]
Sent: Friday, August 21, 2015 10:35 AM
To: Victor Danilchenko <
[hidden email]
>
Subject: Fwd: [awestruct] Awestruct with Markdown -- can't seem to get the sitewide settings to work, and no ToC or default layout

 

Not sure if you saw this response to the list.

 

Also some more info would be good. Which gems are you using,?

---------- Forwarded message ----------
From: Jason Porter <[hidden email]>
Date: Wednesday, August 19, 2015
Subject: [awestruct] Awestruct with Markdown -- can't seem to get the sitewide settings to work, and no ToC or default layout
To: "[hidden email]" <[hidden email]>


Inline

On Wednesday, August 19, 2015, Victor Danilchenko <[hidden email]> wrote:

I have my site compiled using AsciiDoctor, and the following settings in _config/site.yaml set the default behaviors, so that I don’t have to set them one by one:

 

asciidoctor:

  :safe: safe

  :interpolate: true

  :attributes:

    sitename: Cimpress AsciiDoctor docs

    interpolate: true

    toc: right

    name: FooNameAdoc

(etc.)

 

However, when I try to do the same in the ‘markdown:’ section, it gets summarily ignored. I can include such parameters in an .md document via front matter, but I can’t seem to be able to set them side-wide:

 

markdown:

  :safe: safe

  :interpolate: true

  :attributes:

    sitename: Cimpress Markdown docs

    interpolate: true

    toc: right

    name: FooNameMd

       (etc.)

 

Any idea what I am doing wrong?

These settings depend on what engine you're using, they're not awestruct options. The name must also be the name of the engine being used like kramdown for example. Most of those options you have listed are asciidoc options.

 

Also, when I specify ‘toc: right’ in the front matter, it’s getting ignored – Awestruct generates HTML, but without TOC. My front matter does get processed, but apparently not the ‘toc’ flag. Is ToC supported for Markdown, and if so, what should I do to enable it? This might be related to the next question…

I don't know of a markdown engine that supports a toc. 

 

Finally, when I compile an .adoc file, if I don’t specify a layout, it receive a default fairly nice layout for the document (the only actual layout file in my _layouts directory is base.html.haml, and it’s not the one being used); but my .md files are compiled into ugly raw HTML without even document header/body/etc. tags – just raw HTML snippets. Is there something I am missing here? 

You need to add a layout to the frontmatter of each file. 



--
Sent from Gmail Mobile



--
Sent from Gmail Mobile




--
Loading...