<commit_before>= {title}
:title:       Left or Right margin TOC
:description: In this tutorial, we will learn how to add a table of contents in the left/right hand margin of an article or book document.
:doctitle:    Example Template for Asciidoc-Bootstrap - {title}
include::../docs/attributes.asciidoc[]
:footer!:
:navinfo2:

//////////////////////////
   Bootstrap 2 syntax
//////////////////////////
ifeval::["{bsver}"=="2"]
:span11:  span11
:options:
endif::[]

//////////////////////////
   Bootstrap 3 syntax
//////////////////////////
ifeval::["{bsver}"=="3"]
:span11:  col-md-11
:options: responsive
endif::[]


== Left/Right margin Table Of Contents (TOC)

[role="lead"]
This TOC is located in the left or right side of the main content of the document.

.Example of Asciidoc document
..........................
= My Document

== Here are my first table of contents

=== Why not another chapter

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus condimentum dui id lectus viverra placerat.
Sed arcu ipsum, posuere et scelerisque ac, eleifend id turpis. Ut vitae velit congue,
sollicitudin nisi eu, vestibulum lorem. Praesent lectus turpis, ullamcorper vehicula volutpat interdum,
vestibulum condimentum elit. Aliquam erat volutpat. Donec vulputate, dolor vitae molestie convallis,
lacus elit auctor ipsum, sed pharetra augue justo id nisl. Vivamus imperdiet neque ac nunc malesuada,
nec semper mauris viverra. Morbi venenatis ornare dictum. In pulvinar pellentesque felis,
a bibendum mauris tempus interdum. Vestibulum vehicula diam id dolor tincidunt consequat.
Fusce quis enim ultrices metus tincidunt malesuada. Vestibulum at placerat dolor.
Aliquam venenatis aliquam mi sit amet cursus. Donec condimentum dolor ut posuere condimentum.
Vivamus viverra nisl massa. Quisque turpis mauris, ultricies at vehicula nec, ultricies dictum tellus.
..........................

You will used the standard `toc2` attribute of AsciiDoc.
See http://www.methods.co.nz/asciidoc/userguide.html#X91[]

== Result with flatly theme

[role="lead"]
With this theme we will put a TOC in right margin of the document

Enter the following command:
[role="ssh"]
----
$ asciidoc -b bootstrap -a bsver=2 -a theme=flatly -a toc2 -a numbered -a sidebar=right -a jumbotron-fullwidth /path/to/document/demo.asciidoc
----

And here are the final result that you should get.

image::images/screenshots/bs2flatly-toc2-hero.png[link="toc2-sample.html",title="My first TOC2 with flatly theme",style="thumbnail span8 offset1"]

== Result with default theme

[role="lead"]
With this theme we will put a TOC in left margin of the document (default behavior).<commit_msg>fixed dynamic BS behavior (removed old static part)<commit_after>= {title}
:title:       Left or Right margin TOC
:description: In this tutorial, we will learn how to add a table of contents in the left/right hand margin of an article or book document.
:doctitle:    Example Template for Asciidoc-Bootstrap - {title}
include::../docs/attributes.asciidoc[]
:footer!:
:navinfo2:

//////////////////////////
   Bootstrap 2 syntax
//////////////////////////
ifeval::["{bsver}"=="2"]
:span11:  span11
:options:
endif::[]

//////////////////////////
   Bootstrap 3 syntax
//////////////////////////
ifeval::["{bsver}"=="3"]
:span11:  col-md-11
:options: responsive
endif::[]


== Left/Right margin Table Of Contents (TOC)

[role="lead"]
This TOC is located in the left or right side of the main content of the document.

.Example of Asciidoc document
..........................
= My Document

== Here are my first table of contents

=== Why not another chapter

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus condimentum dui id lectus viverra placerat.
Sed arcu ipsum, posuere et scelerisque ac, eleifend id turpis. Ut vitae velit congue,
sollicitudin nisi eu, vestibulum lorem. Praesent lectus turpis, ullamcorper vehicula volutpat interdum,
vestibulum condimentum elit. Aliquam erat volutpat. Donec vulputate, dolor vitae molestie convallis,
lacus elit auctor ipsum, sed pharetra augue justo id nisl. Vivamus imperdiet neque ac nunc malesuada,
nec semper mauris viverra. Morbi venenatis ornare dictum. In pulvinar pellentesque felis,
a bibendum mauris tempus interdum. Vestibulum vehicula diam id dolor tincidunt consequat.
Fusce quis enim ultrices metus tincidunt malesuada. Vestibulum at placerat dolor.
Aliquam venenatis aliquam mi sit amet cursus. Donec condimentum dolor ut posuere condimentum.
Vivamus viverra nisl massa. Quisque turpis mauris, ultricies at vehicula nec, ultricies dictum tellus.
..........................

You will used the standard `toc2` attribute of AsciiDoc.
See http://www.methods.co.nz/asciidoc/userguide.html#X91[]

== Result with flatly theme

[role="lead"]
With this theme we will put a TOC in right margin of the document

Enter the following command:
[role="ssh"]
----
$ asciidoc -b bootstrap -a bsver=2 -a theme=flatly -a toc2 -a numbered -a sidebar=right -a jumbotron-fullwidth /path/to/document/demo.asciidoc
----

And here are the final result that you should get.

image::images/screenshots/bs2flatly-toc2-hero.png[link="toc2-sample.html",title="My first TOC2 with flatly theme",role="thumbnail",style="{span11}",options="{options}"]

== Result with default theme

[role="lead"]
With this theme we will put a TOC in left margin of the document (default behavior).
{'fraction_non_alphanumeric': 0.13876488095238096, 'fraction_numerical': 0.008928571428571428, 'mean_word_length': 3.488313856427379, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2845022', 'n_tokens_mistral': 1789, 'n_tokens_neox': 1729, 'n_words': 646}