why does first line of the adoc file make such a difference?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

why does first line of the adoc file make such a difference?

RichardH
    I've got two adoc files
    "file.adoc" and  "bettername.adoc" [1]
    which are identical except for  the first line of each

    "file.adoc" has first line
        Name of this file;

    "bettername.adoc" has first line
        Made By asciidoctor with github css [2]

    I have got two shell scripts to run those adocs [3]

    The shell scripts are identical except for infile and
    outfile [4]

    But they make very different html5 outfiles

    The html from "file.adoc" has, as expected,
    a nice toc  on the left

    This is totally missing in the html from
    "bettername.adoc"  [5]

    I cannot understand why

    I would be grateful for your help

     Richard H
----------------------------------------------
Details [1..5]

[1] file.adoc reads
Name of this file
=================
Richard Hardwick
v0.01, october 2016
:toc:
:icons:
:numbered:

:Author Initials: RCH



Section one
-----------
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumyeirmod tempor invidunt ut la


[2] The result of $ diff file.adoc bettername.adoc  is
    1c1
    < Name of this file
    ---
    > Made By asciidoctor with github css



[3] The first shell script reads
    asciidoctor \
    --out-file=infile_was_file-adoc.html \
    --backend=html5 \
    -a toc=left \
    -a icons \
    -a
stylesheet=/home/rch/Public/Applications/asciidoc_t2html_etc/asciidoctor_stylesheet_factory/asciidoctor-stylesheet-factory-master/stylesheets/no_longer_used/github.css
\
    file.adoc


[4] The result of diff Make_using_file.sh Make_using_bettername.sh  is
    2c2
    < --out-file=infile_was_file-adoc.html \
    ---
    > --out-file=infile_was_bettername-adoc.html \
    7c7
    < file.adoc
    \ No newline at end of file
    ---
    > bettername.adoc
    \ No newline at end of file

[5]  The result of diff infile_was_file-adoc.html
infile_was_bettername-adoc.html is

    8,9c8
    < <meta name="author" content="Richard Hardwick">
    < <title>Name of this file</title>
    ---
    > <title>Untitled</title>
    719c718
    < <body class="article toc2 toc-left">
    ---
    > <body class="article">
    721,725d719
    < <h1>Name of this file</h1>
    < <div class="details">
    < <span id="author" class="author">Richard Hardwick</span><br>
    < <span id="revnumber">version 0.01,</span>
    < <span id="revdate">october 2016</span>
    727,731c721,723
    < <div id="toc" class="toc2">
    < <div id="toctitle">Table of Contents</div>
    < <ul class="sectlevel1">
    < <li><a href="#_section_one">1. Section one</a></li>
    < </ul>
    ---
    > <div id="content">
    > <div class="paragraph">
    > <p>Made By asciidoctor with github css</p>
    732a725,732
    > <div class="exampleblock">
    > <div class="content">
    > <div class="paragraph">
    > <p>Richard Hardwick
    > v0.01, october 2016
    > :toc:
    > :icons:
    > :numbered:</p>
    734,737d733
    < <div id="content">
    < <div class="sect1">
    < <h2 id="_section_one">1. Section one</h2>
    < <div class="sectionbody">
    739c735,740
    < <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
diam nonumyeirmod tempor invidunt ut la</p>
    ---
    > <p>Section one</p>
    > </div>
    > <div class="listingblock">
    > <div class="content">
    > <pre>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed
diam nonumyeirmod tempor invidunt ut la</pre>
    > </div>
    746,747c747
    < Version 0.01<br>
    < Last updated 2016-10-29 17:16:18 CEST
    ---
    > Last updated 2016-10-29 17:17:23 CEST

        -------- End of Original Message --------


Reply | Threaded
Open this post in threaded view
|

Re: why does first line of the adoc file make such a difference?

ggrossetie
Hello Richard,

The first line is the document title followed by an optional preamble.
In the first case you are producing a document with an header (and a footer). In the other case the title is ignored because you are not using enough '=' character to 'underline' the whole title. Therefore attributes in your document header are ignored.

I strongly advise you to use '=' as a prefix (you type less characters and this will always works) :

= Name of this file

= Made By asciidoctor with github css


Guillaume
Reply | Threaded
Open this post in threaded view
|

Re: why does first line of the adoc file make such a difference?

RichardH
Very many thanks for quick and helpful reply

For others who may come this way,
the ref that I should have consulted is
    http://asciidoctor.org/docs/user-manual/#doc-header

Richard H

/*
 In my own defence, that ref does __not__ seem to explain
 why a adoc file with a header like this

American Politics
=================
Donald Trump
v0.01, october 2016
:toc:
:icons:
:numbered:

:Author Initials: DT


 works without a demur in asciidoctor
 iff there are the right number of "="s

*/

On 10/29/2016 06:33 PM, ggrossetie [via Asciidoctor :: Discussion] wrote:

> Hello Richard,
>
> The first line is the document title followed by an optional preamble.
> In the first case you are producing a document with an header (and a
> footer). In the other case the title is ignored because you are not
> using enough '=' character to 'underline' the whole title. Therefore
> attributes in your document header are ignored.
>
> I strongly advise you to use '=' as a prefix (you type less characters
> and this will always works) :
>
> = Name of this file
>
> = Made By asciidoctor with github css
>
>
> Guillaume
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://discuss.asciidoctor.org/why-does-first-line-of-the-adoc-file-make-such-a-difference-tp5076p5077.html
>
> To start a new topic under Asciidoctor :: Discussion, email
> [hidden email]
> To unsubscribe from Asciidoctor :: Discussion, click here
> <
> NAML
> <
http://discuss.asciidoctor.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>