Re: CustomHTMLConverter

Posted by ggenier on
URL: https://discuss.asciidoctor.org/CustomHTMLConverter-tp8088p8094.html

Ok, it was a file name and extension problem.

I think I do something wrong, I do not have expected result. I tried a lot of things to understand how it works.

I try this :
...
*{tag: %(h#{level + 1}), id: id}
  - if id && (document.attr? :sectanchors)
      a.anchor href="##{id}"
      span(class="title-num") =sectnum =captioned_title
  - elsif id && (document.attr? :sectlinks)
      a.link href="##{id}" span(class="title-num") =sectnum =captioned_title
  - else
      span(class="title-num") =sectnum =captioned_title

- if level == 1
    .sectionbody =content
- else
    =content
...

Number is not showhing.

The only case I have a number on a title (not in chapter) it if i dio this :
...
- if level == 1
    .sectionbody =content
- else
   =sectnum
    =content
...

And I have two lines. If I wrote on one line, number disapear.

I find where title is set, it is here :
...
   - else
      span(class="title-num") =sectnum =captioned_title
...
If I delete line span(class="title-num") =sectnum =captioned_title, title disapear. So I think it is here (at least) I need to do my modification, but I don't understand why =sectnum return null.