Skip to content

Commit 7aae82d

Browse files
committed
litgen-book: add doc / custom bindings + add full pdf
1 parent 64b8da0 commit 7aae82d

37 files changed

+5658
-1833
lines changed

docs/litgen_book/00_00_intro.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@
190190
<li class="toctree-l1"><a class="reference internal" href="07_05_00_templates.html">Template classes and functions</a></li>
191191
<li class="toctree-l1"><a class="reference internal" href="07_05_00_enums.html">Enums</a></li>
192192
<li class="toctree-l1"><a class="reference internal" href="08_05_00_namespaces.html">Namespaces</a></li>
193+
<li class="toctree-l1"><a class="reference internal" href="08_10_00_custom_bindings.html">Manually add custom bindings</a></li>
193194
<li class="toctree-l1"><a class="reference internal" href="09_05_00_preprocessor.html">Preprocessor and macros</a></li>
194195
<li class="toctree-l1"><a class="reference internal" href="10_05_00_ignore_warnings.html">Ignore litgen warnings</a></li>
195196
<li class="toctree-l1"><a class="reference internal" href="11_05_00_post_processing.html">Postprocessing and preprocessing</a></li>
@@ -437,6 +438,11 @@ <h1>litgen<a class="headerlink" href="#litgen" title="Permalink to this heading"
437438
<p class="admonition-title">srcML</p>
438439
<p>litgen is based on <a class="reference external" href="https://www.srcml.org/">srcML</a>, a multi-language parsing tool to convert source code into XML, with a developer centric approach: preprocessor statements are kept unprocessed, and all original text is preserved (including white space, comments and special characters).</p>
439440
</div>
441+
<div class="tip admonition">
442+
<p class="admonition-title">Full pdf version of this book</p>
443+
<p>View or download the <a class="reference external" href="https://pthom.github.io/litgen/litgen_book/litgen_book.pdf">full pdf</a> for this manual.</p>
444+
<p>You may feed it into a LLM such as ChatGPT, so that it can help you with litgen related questions.</p>
445+
</div>
440446
<section id="documented-bindings">
441447
<h2>Documented bindings<a class="headerlink" href="#documented-bindings" title="Permalink to this heading">#</a></h2>
442448
<p>As an intro, here is an example when using bindings generated by litgen inside a python Integrated Development Environment (IDE):</p>
@@ -539,6 +545,7 @@ <h1>Table of contents<a class="headerlink" href="#table-of-contents" title="Perm
539545
<li class="toctree-l1"><a class="reference internal" href="07_05_00_templates.html">Template classes and functions</a></li>
540546
<li class="toctree-l1"><a class="reference internal" href="07_05_00_enums.html">Enums</a></li>
541547
<li class="toctree-l1"><a class="reference internal" href="08_05_00_namespaces.html">Namespaces</a></li>
548+
<li class="toctree-l1"><a class="reference internal" href="08_10_00_custom_bindings.html">Manually add custom bindings</a></li>
542549
<li class="toctree-l1"><a class="reference internal" href="09_05_00_preprocessor.html">Preprocessor and macros</a></li>
543550
<li class="toctree-l1"><a class="reference internal" href="10_05_00_ignore_warnings.html">Ignore litgen warnings</a></li>
544551
<li class="toctree-l1"><a class="reference internal" href="11_05_00_post_processing.html">Postprocessing and preprocessing</a></li>

docs/litgen_book/01_05_00_install_or_online.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
<li class="toctree-l1"><a class="reference internal" href="07_05_00_templates.html">Template classes and functions</a></li>
190190
<li class="toctree-l1"><a class="reference internal" href="07_05_00_enums.html">Enums</a></li>
191191
<li class="toctree-l1"><a class="reference internal" href="08_05_00_namespaces.html">Namespaces</a></li>
192+
<li class="toctree-l1"><a class="reference internal" href="08_10_00_custom_bindings.html">Manually add custom bindings</a></li>
192193
<li class="toctree-l1"><a class="reference internal" href="09_05_00_preprocessor.html">Preprocessor and macros</a></li>
193194
<li class="toctree-l1"><a class="reference internal" href="10_05_00_ignore_warnings.html">Ignore litgen warnings</a></li>
194195
<li class="toctree-l1"><a class="reference internal" href="11_05_00_post_processing.html">Postprocessing and preprocessing</a></li>

docs/litgen_book/01_05_05_online.html

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189
<li class="toctree-l1"><a class="reference internal" href="07_05_00_templates.html">Template classes and functions</a></li>
190190
<li class="toctree-l1"><a class="reference internal" href="07_05_00_enums.html">Enums</a></li>
191191
<li class="toctree-l1"><a class="reference internal" href="08_05_00_namespaces.html">Namespaces</a></li>
192+
<li class="toctree-l1"><a class="reference internal" href="08_10_00_custom_bindings.html">Manually add custom bindings</a></li>
192193
<li class="toctree-l1"><a class="reference internal" href="09_05_00_preprocessor.html">Preprocessor and macros</a></li>
193194
<li class="toctree-l1"><a class="reference internal" href="10_05_00_ignore_warnings.html">Ignore litgen warnings</a></li>
194195
<li class="toctree-l1"><a class="reference internal" href="11_05_00_post_processing.html">Postprocessing and preprocessing</a></li>
@@ -563,7 +564,7 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
563564
</style>
564565

565566
<script>
566-
function copy_code_1757104145974_632() {
567+
function copy_code_1757520190550_061() {
567568
let code = `#################### <generated_from:BoxedTypes> ####################
568569
class BoxedBool:
569570
value: bool
@@ -633,10 +634,10 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
633634
navigator.clipboard.writeText(code);
634635
}
635636
</script>
636-
<button class="collapsible_header" id="btn_1757104145974_632_0" >Corresponding python decls (stub)</button>
637-
<div class="collapsible_content" id="content_1757104145974_632_0">
637+
<button class="collapsible_header" id="btn_1757520190550_061_0" >Corresponding python decls (stub)</button>
638+
<div class="collapsible_content" id="content_1757520190550_061_0">
638639
<div>
639-
<button onclick="copy_code_1757104145974_632()" align="right">copy &#x270d;</button>
640+
<button onclick="copy_code_1757520190550_061()" align="right">copy &#x270d;</button>
640641
</div>
641642
<style>pre { line-height: 125%; }
642643
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
@@ -778,10 +779,10 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
778779
</div>
779780

780781
<script>
781-
var button = document.getElementById("btn_1757104145974_632_0");
782+
var button = document.getElementById("btn_1757520190550_061_0");
782783
button.addEventListener("click", function() {
783784
this.classList.toggle("collapsible_header_opened");
784-
var content = document.getElementById("content_1757104145974_632_0");
785+
var content = document.getElementById("content_1757520190550_061_0");
785786
if (content.style.maxHeight){
786787
content.style.maxHeight = null;
787788
} else {
@@ -791,9 +792,9 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
791792
</script>
792793

793794
<script>
794-
var collapsible_header = document.getElementById("btn_1757104145974_632_0");
795+
var collapsible_header = document.getElementById("btn_1757520190550_061_0");
795796
collapsible_header.classList.toggle("collapsible_header_opened");
796-
var collapsible_content = document.getElementById("content_1757104145974_632_0");
797+
var collapsible_content = document.getElementById("content_1757520190550_061_0");
797798
collapsible_content.style.maxHeight = "80em";
798799
</script>
799800
<br/>
@@ -842,7 +843,7 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
842843
</style>
843844

844845
<script>
845-
function copy_code_1757104145981_499() {
846+
function copy_code_1757520190557_516() {
846847
let code = `//////////////////// <generated_from:BoxedTypes> ////////////////////
847848
auto pyClassBoxedBool =
848849
py::class_<BoxedBool>
@@ -920,10 +921,10 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
920921
navigator.clipboard.writeText(code);
921922
}
922923
</script>
923-
<button class="collapsible_header" id="btn_1757104145981_499_1" >pybind11 C++ binding code</button>
924-
<div class="collapsible_content" id="content_1757104145981_499_1">
924+
<button class="collapsible_header" id="btn_1757520190557_516_1" >pybind11 C++ binding code</button>
925+
<div class="collapsible_content" id="content_1757520190557_516_1">
925926
<div>
926-
<button onclick="copy_code_1757104145981_499()" align="right">copy &#x270d;</button>
927+
<button onclick="copy_code_1757520190557_516()" align="right">copy &#x270d;</button>
927928
</div>
928929
<style>pre { line-height: 125%; }
929930
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
@@ -1073,10 +1074,10 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
10731074
</div>
10741075

10751076
<script>
1076-
var button = document.getElementById("btn_1757104145981_499_1");
1077+
var button = document.getElementById("btn_1757520190557_516_1");
10771078
button.addEventListener("click", function() {
10781079
this.classList.toggle("collapsible_header_opened");
1079-
var content = document.getElementById("content_1757104145981_499_1");
1080+
var content = document.getElementById("content_1757520190557_516_1");
10801081
if (content.style.maxHeight){
10811082
content.style.maxHeight = null;
10821083
} else {
@@ -1086,9 +1087,9 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
10861087
</script>
10871088

10881089
<script>
1089-
var collapsible_header = document.getElementById("btn_1757104145981_499_1");
1090+
var collapsible_header = document.getElementById("btn_1757520190557_516_1");
10901091
collapsible_header.classList.toggle("collapsible_header_opened");
1091-
var collapsible_content = document.getElementById("content_1757104145981_499_1");
1092+
var collapsible_content = document.getElementById("content_1757520190557_516_1");
10921093
collapsible_content.style.maxHeight = "80em";
10931094
</script>
10941095

@@ -1137,7 +1138,7 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
11371138
</style>
11381139

11391140
<script>
1140-
function copy_code_1757104145984_095() {
1141+
function copy_code_1757520190560_3171() {
11411142
let code = `//////////////////// <generated_from:BoxedTypes> ////////////////////
11421143
auto pyClassBoxedBool =
11431144
nb::class_<BoxedBool>
@@ -1214,10 +1215,10 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
12141215
navigator.clipboard.writeText(code);
12151216
}
12161217
</script>
1217-
<button class="collapsible_header" id="btn_1757104145984_095_2" >nanobind C++ binding code</button>
1218-
<div class="collapsible_content" id="content_1757104145984_095_2">
1218+
<button class="collapsible_header" id="btn_1757520190560_3171_2" >nanobind C++ binding code</button>
1219+
<div class="collapsible_content" id="content_1757520190560_3171_2">
12191220
<div>
1220-
<button onclick="copy_code_1757104145984_095()" align="right">copy &#x270d;</button>
1221+
<button onclick="copy_code_1757520190560_3171()" align="right">copy &#x270d;</button>
12211222
</div>
12221223
<style>pre { line-height: 125%; }
12231224
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
@@ -1366,10 +1367,10 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
13661367
</div>
13671368

13681369
<script>
1369-
var button = document.getElementById("btn_1757104145984_095_2");
1370+
var button = document.getElementById("btn_1757520190560_3171_2");
13701371
button.addEventListener("click", function() {
13711372
this.classList.toggle("collapsible_header_opened");
1372-
var content = document.getElementById("content_1757104145984_095_2");
1373+
var content = document.getElementById("content_1757520190560_3171_2");
13731374
if (content.style.maxHeight){
13741375
content.style.maxHeight = null;
13751376
} else {
@@ -1379,9 +1380,9 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
13791380
</script>
13801381

13811382
<script>
1382-
var collapsible_header = document.getElementById("btn_1757104145984_095_2");
1383+
var collapsible_header = document.getElementById("btn_1757520190560_3171_2");
13831384
collapsible_header.classList.toggle("collapsible_header_opened");
1384-
var collapsible_content = document.getElementById("content_1757104145984_095_2");
1385+
var collapsible_content = document.getElementById("content_1757520190560_3171_2");
13851386
collapsible_content.style.maxHeight = "80em";
13861387
</script>
13871388
<br/>
@@ -1430,7 +1431,7 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
14301431
</style>
14311432

14321433
<script>
1433-
function copy_code_1757104145984_722() {
1434+
function copy_code_1757520190561_053() {
14341435
let code = `struct BoxedBool
14351436
{
14361437
bool value;
@@ -1441,10 +1442,10 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
14411442
navigator.clipboard.writeText(code);
14421443
}
14431444
</script>
1444-
<button class="collapsible_header" id="btn_1757104145984_722_3" >C++ glue code</button>
1445-
<div class="collapsible_content" id="content_1757104145984_722_3">
1445+
<button class="collapsible_header" id="btn_1757520190561_053_3" >C++ glue code</button>
1446+
<div class="collapsible_content" id="content_1757520190561_053_3">
14461447
<div>
1447-
<button onclick="copy_code_1757104145984_722()" align="right">copy &#x270d;</button>
1448+
<button onclick="copy_code_1757520190561_053()" align="right">copy &#x270d;</button>
14481449
</div>
14491450
<style>pre { line-height: 125%; }
14501451
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
@@ -1527,10 +1528,10 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
15271528
</div>
15281529

15291530
<script>
1530-
var button = document.getElementById("btn_1757104145984_722_3");
1531+
var button = document.getElementById("btn_1757520190561_053_3");
15311532
button.addEventListener("click", function() {
15321533
this.classList.toggle("collapsible_header_opened");
1533-
var content = document.getElementById("content_1757104145984_722_3");
1534+
var content = document.getElementById("content_1757520190561_053_3");
15341535
if (content.style.maxHeight){
15351536
content.style.maxHeight = null;
15361537
} else {
@@ -1540,9 +1541,9 @@ <h1>Use litgen online<a class="headerlink" href="#use-litgen-online" title="Perm
15401541
</script>
15411542

15421543
<script>
1543-
var collapsible_header = document.getElementById("btn_1757104145984_722_3");
1544+
var collapsible_header = document.getElementById("btn_1757520190561_053_3");
15441545
collapsible_header.classList.toggle("collapsible_header_opened");
1545-
var collapsible_content = document.getElementById("content_1757104145984_722_3");
1546+
var collapsible_content = document.getElementById("content_1757520190561_053_3");
15461547
collapsible_content.style.maxHeight = "80em";
15471548
</script>
15481549
</div></div>

0 commit comments

Comments
 (0)