-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathindex.bigb
More file actions
13453 lines (10150 loc) · 491 KB
/
index.bigb
File metadata and controls
13453 lines (10150 loc) · 491 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
= OurBigBook Project
{c}
= OurBigBook
{c}
{synonym}
\b[https://OurBigBook.com[]]: the best way to publish your scientific knowledge.
The \b[OurBigBook Project] is creating the ultimate https://github.com/ourbigbook/ourbigbook[open source] tools to <publish> \b[textbooks]/\b[<#personal knowledge bases>]/\b[<#Zettelkasten>]/\b[<#digital gardens>] in the <#learn in public> philosophy. It is our best shot yet at the final \b[real-world <#Encyclopedia Galactica>] by allowing effective \b[<#mindmeld>[mind melding]]/\b[<#collective intelligence>] via the \b[<topics feature>].
\Image[logo.svg]
{height=150}
{title=<project logo>[Logo of] the <OurBigBook Project>}
This is the <OurBigBook CLI quick start> using our <template project> https://github.com/ourbigbook/template[]. After https://nodejs.org/en/download[installing Node.js], run:
``
git clone https://github.com/ourbigbook/template
cd template
npm install
npx ourbigbook .
firefox _out/html/index.html
firefox _out/html/not-index.html
``
This HTML output is also visible at: https://ourbigbook.github.io/template Tested on <OurBigBook CLI test matrix>[Linux, MacOS and Windows].
To <publish>[publish your project as a static website to GitHub Pages], first create a GitHub repository for it, e.g. `johnsmith/mybrain` and then:
```
git remote set-url origin git@github.com:ourbigbook/ourbigbook-private.git
ourbigbook --publish
```
and your project is now published to https://johnsmith.github.io/template
To publish your project to https://OurBigBook.com[], create an account at https://ourbigbook.com/go/register[] and then:
``
ourbigbook --web
``
This will ask for your ourbigbook username and password, and then your project will be published at: https://ourbigbook.com/johnsmith[].
A full blown showcase knowledge base can be seen at:
* https://cirosantilli.com (<static website> publish)
* https://ourbigbook.com/cirosantilli (equivalent on <OurBigBook.com> with dynamic website features such as <topics>)
* https://github.com/cirosantilli/cirosantilli.github.io (source code for both of the above)
\b[Mission]: to live in a world where you can learn university-level #mathematics{p}, #physics{p}, <#chemistry>, #biology and #engineering from perfect free open source books that anyone can write to get famous.
\b[Ultimate goal]: destroy the currently grossly inefficient education system and replace it with a much more inspiring system where people learn what they want as fast as possible to reach their goals faster without so much useless pain.
\b[How to get there]: <OurBigBook Web>[create a website] (live at \b[https://OurBigBook.com[]]) that incentivizes learners (notably university students taking courses) to write freely licensed university-level natural science books in their own words for free. Their motivation for doing that are:
* getting their knowledge globally recognized and thus better jobs
* improving the world
* learning by teaching
\Video[https://www.youtube.com/watch?v=7JOJYx0mmhg]
{title=Introduction to the <OurBigBook Project>}
{height=500}
\b[Notable features]:
\Ol[
* \b[<topics>]: groups the articles of different users about the same topic, sorted by upvote to achieve <#mindmeld>[mind melding]/<#collective intelligence>. This makes your articles easier for others to find.
\Image[feature/topics/derivative.png]
{title=The <topics feature> allows you to find the best version of a subject written by other users user}
{description=Live demo: <#derivative>.}
{provider=github}
{height=1000}
{border}
\Video[https://www.youtube.com/watch?v=54nxjC9BWTg]
{title=<OurBigBook Web topics> demo}
{disambiguate=intro}
{height=700}
{width=700}
* \b[local editing]: you can store all your <#personal knowledge base> content locally in a <OurBigBook Markup>[plaintext markup format] that can be edited locally and <published> with <OurBigBook CLI> to either:
* \b[to <OurBigBook.com>]: to get awesome multi-user features like <OurBigBook Web topics>
* \b[as HTML files to a <static website>]: you can host yourself for free on many external providers like <GitHub Pages>, and remain in full control
This way you can be sure that even if <ourbigbook.com> were to go down one day (which we have no plans to as it is quite cheap to host!), your content will still be perfectly readable as a static site.
\Image[feature/local-editing/bigb-publish-to-web-or-static-editor-logos.svg]
{title=With OurBigBook you can <publish> local <OurBigBook markup>[lightweight markup files] to either <OurBigBook Web> or as a <static website>}
{description=
For example, both of the following pages:
* https://cirosantilli.com (static)
* https://ourbigbook.com/cirosantilli (dynamic)
are generated from the exact same source code at: https://github.com/cirosantilli/cirosantilli.github.io[].
}
{provider=github}
{height=600}
{disambiguate=intro}
\Image[feature/vscode/tree.png]
{title=<Visual Studio Code extension> tree navigation}
{provider=github}
{height=1100}
{disambiguate=intro}
{border}
\Image[feature/web-editor/cirosantilli-derivative.png]
{title=<Web editor>}
{description=You can also edit articles on the <Web editor> without installing anything locally.}
{provider=github}
{height=800}
{border}
{disambiguate=intro}
\Image[feature/web-editor/topic-link.png]
{title=Creating a new article on the web editor}
{border}
{height=457}
{provider=github}
\Video[https://www.youtube.com/watch?v=Ghvlztiu6rI]
{title=Edit locally and <publish> demo}
{disambiguate=intro}
{description=This shows editing <OurBigBook Markup> and <publishing> it using the <VS Code> extension.}
{height=720}
{width=720}
\Video[https://www.youtube.com/watch?v=0W8U2YtQ8fg]
{title=OurBigBook <Visual Studio Code extension>}
{disambiguate=intro}
{height=600}
* \Image[feature/x/hilbert-space-arrow.png]
{title=<Internal cross file internal link>}
{provider=github}
{height=571}
{border}
{disambiguate=intro}
{description=
<OurBigBook> supports <internal links> to clean IDs that don't depend on either:
* source code file paths
* <table of contents> tree position
For example, in this screenshot, we are able to link simply from the file:
``
quantum-mechanics.bigb
``
with:
``
<Hilbert space>
``
to the <header>:
``
= Hilbert space
``
present in another file:
``
calculus.bigb
``
without specifying:
* the source code path `calculus.bigb`
* the full tree position: `Mathematics` \> `Area of mathematic`s \> `Calculus` \> `Hilbert space`
This means that you can freely change the location of headers or the tree structure and your links will still work.
<OurBigBook> also automatically checks for broken links every time you build, so you will never have a broken link again.
Live output URLs:
* https://cirosantilli.com/calculus#hilbert-space
* https://cirosantilli.com/quantum-mechanics#schrodinger-picture
* https://ourbigbook.com/cirosantilli/hilbert-space
* https://ourbigbook.com/cirosantilli/schrodinger-picture
}
* \Image[feature/tag/non-toplevel-documentary-sell.png]
{title=Non-toplevel <tagged> headers demo}
{disambiguate=intro}
{description=
Visible live at: https://cirosantilli.com/film#documentary-film
With <OurBigBook>, <tags> are just headers.
This allows you to add arbitrary comments to your tags explaining them as the need arises.
}
{provider=github}
{border}
{height=950}
* \Image[feature/scope/h1-breadcrumb-arrow.png]
{title=If your ID prefixes are getting too large, we have <scopes> for you.}
{border}
{height=499}
{provider=github}
{source=https://ourbigbook.com/cirosantilli/x86-paging/sample-code}
* \b[infinitely deep table of contents]: never again be limited to only 6 levels of HTML `h6` legacy limitations! With <OurBigBook>, the sky is the limit!
Furthermore, with our <dynamic article tree> of <OurBigBook Web>, every header can be the toplevel header for better SEO and user experience e.g. both the following pages show all their ancestors:
* https://ourbigbook.com/cirosantilli/chordate
* https://ourbigbook.com/cirosantilli/chordate-subclade
\Image[feature/dynamic-article-tree/demo.png]
{title=<Dynamic article tree> with infinitely deep table of contents}
{description=
Live URL: https://ourbigbook.com/cirosantilli/chordate
Descendant pages can also show up as toplevel e.g.: https://ourbigbook.com/cirosantilli/chordate-subclade[]
}
{provider=github}
{height=2700}
{border}
{disambiguate=intro}
\Image[cirosantilli.com/chordate/main.png]
{title=And this is how the same article looks on the static website}
{description=Live URL: https://cirosantilli.com/taxonomy#chordate}
{provider=github}
{height=1700}
{border}
{disambiguate=intro}
* \Image[feature/search/physics-arrow.png]
{title=<OurBigBook Web search> demo}
{description=
Search for your and other people's articles.
Visible live at: https://ourbigbook.com/go/articles?body=false&search=physics-and
}
{provider=github}
{border}
{height=650}
{disambiguate=intro}
* Every single section has a clear and sane <OurBigBook Web discussions>[discussion area], where you can easily ask the author for clarifications and corrections, and where other readers can find answers to their problems in older existing discussions.
\Image[Fundamental_theorem_of_calculus_subheader_discussion_arrow.png]
{title=<OurBigBook Web discussion> links from the section headers}
{border}
{height=725}
{provider=github}
{description=Every section has a "Discussions" button where URL: https://ourbigbook.com/barack-obama/integral#fundamental-theorem-of-calculus[]}
\Image[Fundamental_theorem_of_calculus_by_Barack_Obama_discussions.png]
{title=<OurBigBook Web discussion> list for a given article}
{border}
{height=423}
{provider=github}
{description=We can then list all the existing discussions for a given header. URL: https://ourbigbook.com/go/discussions/barack-obama/fundamental-theorem-of-calculus[]}
\Image[Fundamental_theorem_of_calculus_by_Barack_Obama_discussion_1.png]
{title=<OurBigBook Web discussion> example}
{border}
{height=1043}
{provider=github}
{description=This is how a specific discussion looks like. URL: https://ourbigbook.com/go/discussion/1/barack-obama/fundamental-theorem-of-calculus[]}
* \Image[feature/announce/button-arrow.png]
{title=With </article announcement> you can send a link to your articles to your followers}
{border}
{height=712}
{provider=github}
{source=https://ourbigbook.com/cirosantilli/chain-rule}
]
\Image[feature/file.png]
{title=OurBigBook <`\H` `file` argument>[file feature]}
{disambiguate=intro}
{description=You can create OurBigBook articles that talk about specific files such as images or source code. Such articles appear inside the global <table of contents> like other articles,. A preview of the file is automatically shown in the article when possible. Directory listings are also automatically generated to allow readers to navigate through all your files.}
{border}
{height=785}
{provider=github}
{source=https://cirosantilli.com/_dir/nodejs/}
\Image[github_com_ourbigbook_ourbigbook.png]
{title=OurBigBook GitHub repository}
{source=https://github.com/ourbigbook/ourbigbook}
{description=Everything that the <OurBigBook Project> does is open source.}
{provider=github}
{height=1000}
\b[Key links]:
* https://OurBigBook.com[]: reference <OurBigBook Web> instance
* donate to the OurBigBook Project: <donate>
* project announcements: <news>{full}. Also posted in shorter form to <official accounts>{full} such as:
* https://twitter.com/OurBigBook[]
* https://mastodon.social/@OurBigBook
* https://cirosantilli.com/ourbigbook-com[]: further rationale behind the project by the founder <Ciro Santilli>
* https://cirosantilli.com[]: showcase static demo document with interesting content, published with <OurBigBook CLI>. Primary inspiration for OurBigBook development.
* https://cirosantilli.com/oxford-nanopore-river-bacteria[]: a self-contained tutorial style part of the above. Note how <internal links> integrate seamlessly into the more global topic of biology, e.g. when talking about DNA we link to the global topic https://cirosantilli.com/dna[].
* https://github.com/cirosantilli/cirosantilli.github.io[] and https://github.com/cirosantilli/cirosantilli.github.io/blob/dev/oxford-nanopore-river-bacteria.bigb[]: source of the above showcase documents
* <design goals>{full}: <OurBigBook Markup> and <OurBigBook CLI> feature overview
* https://github.com/ourbigbook/ourbigbook[]: OurBigBook source code
* https://github.com/ourbigbook/ourbigbook/issues[]: project issue tracker
* https://github.com/ourbigbook/ourbigbook/blob/master/index.bigb[]: source for this document
* https://docs.ourbigbook.com[]: rendered version of this document
* https://docs.ourbigbook.com/_obb/dist/editor[]: live in-browser editor demo
* https://github.com/ourbigbook/template[]: good template to get started with <OurBigBook CLI>, see <OurBigBook CLI quick start>{full}
* https://ourbigbook.github.io/template[]: the above <published to GitHub Pages>
* https://cirosantilli.com/ourbigbook-media[]: media for the project such as for documentation and <publicity>, more info: <OurBigBook media repository>{full}
= Donate
{parent=}
To donate:
* https://cirosantilli.com/sponsor[]: give money directly to <Ciro Santilli>
* buy project merchandise, see: <merchandise>{full}
All donated money currently just goes directly to <Ciro Santilli>'s personal bank account, the project founder and current lead. If things ever take off we will set up a legal entity to make things cleaner. One may dream. But for now, it would just add unnecessary overhead. Related: <Project governance>{full}.
Ciro announces funding milestones and transparently accounts for all donations at: https://cirosantilli.com/sponsor[]. When milestones are reached, he quits his day job and works full time on the project for a given amount of time.
We are also happy to discuss paid contracts to implement specific features, to get in touch see: <contact>.
= Quick start
{parent=}
The following sections cover different ways to use tools from the OurBigBook:
* <OurBigBook Web user manual>: manual for <OurBigBook Web>, the dynamic website. With this approach, you can write content on the browser without downloading anything, and save it on our database.
* convert local `.bigb` files with either:
* <Visual Studio Code quick start>
* <OurBigBook CLI quick start>
This method allows you to publish either as:
* a <static website>
* to <OurBigBook Web>
* <OurBigBook Markup quick start>: covers specifically <OurBigBook Markup>, which is the markup language you use to write content in OurBigBook, both <OurBigBook Web> and <OurBigBook CLI>.
This is currently the only way to write OurBigBook content, but we would really like to add <todo/WYSIWYG>[WYSIWYG] editor support one day!
= OurBigBook vs other systems
{parent=}
= OurBigBook vs other mind-melding systems
{parent=OurBigBook vs other systems}
This section compares <OurBigBook> with other websites that attempt to do mind-melding, which <OurBigBook> attempts through the <Topics feature>.
In particular, we mean mind-melding without a simple centralized authority.
= OurBigBook vs Wikipedia
{parent=OurBigBook vs other mind-melding systems}
= Wikipedia
{synonym}
<OurBigBook> is a bit like a <#Wikipedia> where each person can have their own version of every article.
This addresses the main shortcomings of Wikipedia:
* contributors are not clearly recognized for their contributions. Clearly knowing who wrote what, and having upvotes and reputation is an essential motivation mechanism for free knowledge contributors.
* what you write can be deleted at any time, for two major reasons:
* excessive notability guidelines
* the requirement for "encyclopedic tone", which precludes in theory tutorials
If you spend four hours writing a tutorial for a website and it gets deleted without comment, you are never ever going to write everything for that website again.
In <OurBigBook>, you can write about whatever you want, and no one can delete it.
* inconsistent page granularity: it is somewhat random if an article deserves to be a toplevel page, or only a subheader. With <OurBigBook>, every header is a toplevel page with the <dynamic article tree> feature.
\Image[https://upload.wikimedia.org/wikipedia/en/8/80/Wikipedia-logo-v2.svg]
= OurBigBook vs Stack Overflow
{parent=OurBigBook vs other mind-melding systems}
= Stack Overflow
{synonym}
= Stack Exchange
{synonym}
<#Stack Overflow> and other <#Q&A websites> solve the main issues of <OurBigBook vs Wikipedia>[Wikipedia]:
* they give clear recognition to users' contributions
* they make it much less likely that your content will be deleted by others (though it can still happen sometimes)
The limitation of <#Stack Exchange> is that you cannot write a book on it, and anything judged to be "too general" will be closed or deleted. In other words, it can only contain the smallest units of knowledge, and lacks a table of content mechanism to group knowledge together more broadly.
Therefore, while it basically perfectly solves "shallower subjects" such as computer programming, it is insufficient for "deeper" subjects with longer dependency chains of knowledge such as mathematics and physics.
To a large extent, the goal of OurBigBook is to combine the strengths of <#Stack Exchange> with those of <#Wikipedia>.
\Image[https://upload.wikimedia.org/wikipedia/commons/0/02/Stack_Overflow_logo.svg]
{height=100}
= OurBigBook vs Knol
{parent=OurBigBook vs other mind-melding systems}
<OurBigBook> is quite similar to the now defunct <#Knol>, a <#Google> project that basically made a Wiki where each person can have their own version of each article.
Knol ran from 2008 until its shutdown in 2012, and failed to attract enough attention that Google would keep it running.
It is our belief however that the website had great promise and potential value, and simply would generate profits too small to compare with other Google projects.
Knol also lacks a mechanism to store your notes locally, which we believe is essential if you want to get people to use as a system for people to dump large chunks into.
\Image[https://upload.wikimedia.org/wikipedia/commons/4/4b/Knol-logo.svg]
{height=100}
= OurBigBook vs other non-mind-melding systems
{parent=OurBigBook vs other systems}
The main distinguishing feature of <OurBigBook> from other scientific publishing methods is mind-melding via <topics>.
It is perfectly possible to use OurBigBook without ever targeting mind meld, and we want to make that use case as awesome as we can.
There are many methods for people to publish their scientific knowledge online, each with their own strengths and weaknesses, but we believe that mind-melding is essential for a project to be able to truly take off.
<OurBigBook> seeks to pick the best of each of those methods, while also adding the mild-melding aspect on top, which we believe to be so transformative.
Types typically non-mind-melding systems include:
* <#note taking software>
* <#personal knowledge base software>
* putting PDFs on a university FTP servers (a classic!)
* blogs
<OurBigBook> is essentially a <#note taking software> with mind-melding added on top of it.
Some noteworthy non-mind-meld software include:
* <#Forester>: this software comes the closest in initial design philosophy to OurBigBook, with a native plaintext format and scientific focus
* <#Trillium Notes>: amazing local <#WYSIWYG> note taking app with a bug table of contents. Also has a web version even!
= OurBigBook Markup and CLI overview
{parent=}
= Features
{parent=OurBigBook Markup and CLI overview}
* <internal links> to any <header> (including e.g. h2, h3, etc. <internal links>[in other files]), <images>, etc. with amazing <error reporting>[error checking and reporting]: never break <internal links> without knowing again, and quickly find out what broke when you do. E.g.:
animal.bigb
``
= Animal
<Bats> are <flying animals>.
``
Mammal.bigb
``
= Flying animal
== Bat
``
`Animal.bigb` would render something like:
``
<a href="flying-animal.html#bat">Bats</a> are <a href="flying-animal.html">flying animals</a>.
``
The following would fail and point you out the file and line of the failure:
* nonexistent id:
``
<Weird animal not documented>
``
* duplicate IDs:
``
= Animal
== Dog
== Cat
== Dog
``
* https://katex.org/[KaTeX] server side <mathematics>, works on browsers with <OurBigBook Web with JavaScript disabled>[JavaScript disabled]:
``
I like $\sqrt{2}$, but I adore this \x[equation-quadratic-equation]:
$$
x^2 + 2x + 1
$$
{title=Quadratic equation}
``
* multi-file features out of the box so you don't need a separate wrapper like Jekyll to make a multi-page website:
* <cross file internal links>
* single-source multi-format output based on <includes> and build options:
* by default, one HTML per source with includes rendered as links between pages, e.g.:
index.bigb
``
= My website
== h2
\Include[not-index]
``
not-index.bigb
``
= Not index
== Not index h2
``
produces `index.html` and `not-index.html`
* with the <split headers> option, you can output each header of an input file into a separate output file. The previous filesystem would produce:
* `index.html`: which contains the full `index.bigb` output
* `split.html`: split version of the above containing only the `= My website` header and not `h2`
* `h2.html`: only contains the `h2` header
* `not-index.html` contains the full output of `not-index.bigb`
* `not-index-split.html`: only contains the `= Not index` header
* `not-index-h2.html`: only contains the `= Not index h2` header
Each of those pages automatically gets a <table of contents>
* <--embed-includes> single file output from multiple input files. Includes are parsed smartly, not just source copy pasted, e.g. included headers are shifted from `h1` to `h2` correctly.
On the previous sample filesystem, it would produce a single output file `index.html` which would contain a header structure like:
``
= My website
== h2
=== Not index
==== Not index h2
``
* supports both local serverless rendering to HTML files for local viewing, and server oriented rendering such as GitHub pages, e.g. <internal links> automatically get `.html` extension and or not. E.g.:
* locally, a link `\x[not-index]` would render as `<a href="not-index.html">` and `not-index.bigb` produces `not-index.html`
* when publishing, `\x[not-index]` would render as `<a href="not-index">` and `not-index.bigb` also produces `not-index.html`, which the server converts to just `http://my-website.com/not-index`
* cross file configuration files to factor out common page parts like headers, footers and other metadata, e.g.:
* `ourbigbook.liquid.html`: https://github.com/Shopify/liquid[Liquid template] used for all pages, see example at: <play with the template>{full}
* `main.scss`: CSS stylesheet generated from https://sass-lang.com/[SASS] input, see example at: <play with the template>{full}
* `ourbigbook.tex`: global LaTeX math definitions, e.g.:
``
\newcommand{\abs}[1]{\left|#1\right|}
``
and then you can use:
``
$\abs{x}$
``
in any .bigb file of the project.
* <ourbigbook.json>: per repository configuration options
* <table of contents> that crosses input files via includes. E.g. in:
index.bigb
``
= My website
== h2
\Include[not-index]
``
not-index.bigb
``
= Not index
== Not index h2
``
the table of contents for `index.html` also contains the headers for `not-index.bigb` producing:
* My website
* h2
* Not index
* Not index h2
This means that you can split large <\H splitDefault argument>[splitDefault] input files if rendering starts to slow you down, and things will still render exactly the same.
* check that local files and images linked to actually exist: <\a external argument>. E.g.:
``
\a[i-don-exist.txt]
``
would lead to a build error.
* associate headers to files or directories with the <\H file argument> e.g.:
``
Here's an example of a nice image: \x[path/to/my/image.png]{file}.
= path/to/my/image.png
{file}
This image was taken when I was on vacation!
``
would automatically add a preview of the image on the output. Display files and their metadata nicely directly on your static website rather than relying exclusively on GitHub as a file browser.
* advanced header/ID related features:
* <ID-based header levels>:
``
= Furry animal
I like \x[furry-animal]{p}, especially my cat, here is his photo: \x[image-my-cat].
== Cat
\Image[My_cat.jpg]
{title=My cat}
``
* <scopes> either with directories or with within a single file:
``
See the important conclusion of my experiment: \x[report-of-my-experiment/conclusion]
= Report of my experiment
{scope}
== Introduction
== Middle
== Conclusion
``
* <internal link title inflection> for capitalization and pluralization, e.g.;
``
= Dog
== Snoopy
{c}
\x[dog]{c}{p} are fun. But the \x[dog] I like the most is \x[snoopy]!
``
would render:
* `\x[dog]{c}{p}` as `Dogs`: capitalized because of `{c}` and pluralized because of `{p}`
* `\x[dog]` as `dogs`: auto lowercased because its header `= Dog` does not have `{c}`
* `\x[snoopy]` as `Snoopy`: title capitalization kept to upper case due to `{c}` on the header `== Snoopy`
* <synonyms>, e.g.:
``
= User interface
= UI
{c}
{synonym}
{title2}
\x[user-interface]{c} is too long, I just say \x[ui].
``
would render something like:
``
<a href="#user-interface">User interface</a> is too long, I just say <a href="user-interface">UI</a>
``
Furthermore, this also generates a output file:
``
ui.html
``
which redirects to the ain `user-interface.html`, so it serves as a way to have backward compatibility on page renames.
And the `title2` makes it appears on the main title under parenthesis, something like:
``
<h1>User interface (UI)</h1>
``
* <\H disambiguate argument>[header disambiguation], e.g.:
``
My favorite fruits are \x[apple-fruit]{p}!
My favorite least favorite brand is is \x[apple-company]! \x[apple] computers are too expensive.
== Apple
{disambiguate=fruit}
== Apple
{c}
{disambiguate=company}
= Apple
{c}
{synonym}
``
which renders something like:
* `\x[apple-fruit]{p}`: `<a href="apple-fruit">apples</a>`
* `\x[apple-company]`: `<a href="apple-company">Apple</a>`
* `\x[apple]`: also `<a href="apple-company">Apple</a>` because of the synonym
* `== Apple\n{disambiguate=fruit}`: `<h2 id="apple-fruit">Apple (fruit)</h2>`
* `== Apple\n{disambiguate=company}`: `<h2 id="apple-company">Apple (company)</h2>`
* tags are regular headers: <\H child argument>, <\x child argument>
``
= Animal
== Dog
{tag=domestic}
{tag=cute}
== Cat
{tag=domestic}
{tag=cute}
== Bat
{tag=flying}
= Flying
= Cute
= Domestic
``
* <unlimited header levels>, levels higher than 6 are rendered in HTML as an appropriately styled `div`s with an ID:
``
= h1
== h2
=== h3
==== h4
===== h5
====== h6
======= h7
======== h8
``
* generate lists of <incoming links> between internal headers: it shows every <internal link> coming into the current page
* automatic file upload and directory listing of non OurBigBook files: <`_raw` directory>, e.g.:
* link to a file:
\OurBigBookExample[[
The file \a[index.js] is cool.
]]
* link to a directory:
\OurBigBookExample[[
The directory \a[file_demo] is cooler.
]]
* is written in JavaScript and therefore runs natively on the browser to allow live previews as shown at: https://docs.ourbigbook.com/_obb/dist/editor[]
* helps you with the publishing:
* <ourbigbook --publish> publishes in a single command to the configured target (default <GitHub Pages>)
* OurBigBook tries to deal with media such as images and video intelligently for you, e.g.: <where to store images>{full}. E.g. you can keep media in a separate media repository, `my-media-repository`, and then by configuring on <ourbigbook.json>:
``
"media-providers": {
"github": {
"default-for": ["image", "video"],
"path": "media",
"remote": "yourname/myproject-media"
}
}
``
you can use images in that repository with:
``
\Image[My_image_basename.jpg]
``
instead of:
``
\Image[https://raw.githubusercontent.com/cirosantilli/myproject--media/master/My_image_basename.jpg]
``
* `inotifywait` watch and automatically rebuild with <watch>:
``
ourbigbook --watch input-file.bigb
``
* automatic code formatting: <--format-source>
= Design goals
{parent=OurBigBook Markup and CLI overview}
OurBigBook is designed entirely to allow writing complex professional HTML and PDF scientific books, blogs, articles and encyclopedias.
OurBigBook aims to be the ultimate <latex output format>[LaTeX] "killer", allowing books to be finally published as either HTML or PDF painlessly (LaTeX being only a backend to PDF generation).
It aims to be <features>[more powerful] and <saner> and than Markdown and Asciidoctor.
= Saner
{parent=Design goals}
Originally, OurBigBook was is meant to be both saner and more powerful than Markdown and Asciidoctor.
But alas, as Ciro started implementing and using it, he started to bring some Markdown <macro shorthand syntax>[syntax sugar he missed back in].
And so this "degraded" slightly into a language slightly saner than Asciidoctor but with an amazing Node.js implementation that makes it better for book writing and website publishing.
Notably, we hope that our escaping will be a bit saner backslash escapes everything instead of Asciidoctor's "different escapes for every case" approach: https://github.com/asciidoctor/asciidoctor/issues/901
But hopefully, having starting from a saner point will still produce a saner end result, e.g. there are explicit constructs for every shorthand one.
It is intended that this will be an acceptable downside as OurBigBook will be used primarily large complex content such as books rather than forum posts, and will therefore primarily written either:
* in text editors locally, where users have more features than in random browser textareas
* in a dedicated website that will revolutionize education, and therefore have a good JavaScript editing interface: https://github.com/cirosantilli/write-free-science-books-to-get-famous-website
For example, originally OurBigBook had exactly five magic characters, with similar functions as in LaTeX:
* `\` backslash to start a macro, like LaTeX
* `{` and `}`: left and right square brackets to delimit <positional vs named arguments>[optional macro arguments]
* `[` and `]`: left and right curly braces bracket to start an optional arguments
and double blank newlines for <paragraphs> if you are pedantic, but this later degenerated into many more with <macro shorthand syntaxes>.
We would like to have only square brackets for both optional and mandatory to have even less magic characters, but that would make the language difficult to parse for computer and humans. LaTeX was right for once!
This produces a very regular syntax that is easy to learn, including doing:
* arbitrary nesting of elements
* adding arbitrary properties to elements
This sanity also makes the end tail learning curve of the endless edge cases found in Markdown and Asciidoctor disappear.
The language is designed to be philosophically isomorphic to HTML to:
* further reduce the learning curve
* ensure that most of HTML constructs can be reached, including arbitrary nesting
More precisely:
* macro names map to tag names, e.g.: `\\a` to `<a`
* one of the arguments of macros, maps to the content of the HTML element, and the others map to attributes.
E.g., in a link:
``
\a[http://example.com][Link text\]
``
the first macro argument:
``
http://example.com
``
maps to the `href` of `<a`, and the second macro argument:
``
Link text
``
maps to the internal content of `<a>Link text<>`.
= More powerful
{parent=Design goals}
The <saner>[high sanity of OurBigBook], also makes creating new macro extensions extremely easy and intuitive.
All built-in language features use the exact same API as new extensions, which ensures that the extension API is sane forever.
Markdown is clearly missing many key features such as block attributes and <internal links>, and has no standardized extension mechanism.
The "more powerful than Asciidoctor" part is only partially true, since Asciidoctor is very featureful can do basically anything through extensions.
The difference is mostly that OurBigBook is completely and entirely focused on making amazing scientific books, and so will have key features for that application out-of-the box, notably:
* amazing header/ToC/ID features including proper error reports: never have a internal broken link or duplicate ID again
* <mathematics>[server side pre-rendered maths with KaTeX]: all divs and spans are ready, browser only applies CSS, no JavaScript gets executed
* <publish>: we take care of website publishing for you out-of-the-box, no need to integrate into an external project like Jekyll
* <split headers>:
* https://github.com/asciidoctor/asciidoctor/issues/626 feature request
* https://github.com/owenh000/asciidoctor-multipage third party plugin that does it
and we feel that some of those features have required specialized code that could not be easily implemented as a standalone macro.
Another advantage over Asciidoctor is that the reference implementation of OurBigBook is in JavaScript, and can therefore be used on browser live preview out of the box. Asciidoctor does Transpile to JS with https://github.com/opal/opal[Opal], but who wants to deal with that layer of complexity?
= Related projects
{parent=Design goals}
Static wiki generators: this is perhaps the best way of classifying this project :-)
* https://github.com/gollum/gollum[]: already has a local server editor! But no WYSIWYG nor live preview. Git integration by default, so when you save on the UI already generates a Git commit. We could achieve that with: https://github.com/isomorphic-git/isomorphic-git[], would be really nice. Does not appear to have built-in static generation:
* https://stackoverflow.com/questions/7210391/have-anyone-use-gollum-site-to-generete-markdown-wikis-and-host-it-on-heroku
* https://github.com/dreverri/gollum-site
Does not appear to check that any links are correct.
* https://github.com/wcchin/markypydia
* https://obsidian.md/ closed source, Markdown with <cross file internal link> + a SaaS. Appears to require payment for any publishing. 28k followers 2021: https://twitter.com/obsdmd[]. Founders are likely Canadians of Asian descent from Waterloo University: https://www.linkedin.com/in/lishid/ | https://www.linkedin.com/in/ericaxu/ also working in parallel on https://dynalist.io/ 2020 review at: https://www.youtube.com/watch?v=aK2fOQRNSxc Has offline editor with side-by-side preview. Compares with https://roamresearch.com/[Roam] and https://roamresearch.com/[Notion], but can't find any public publishing on those, seem to be enterprise only things.
Static book generators:
* https://github.com/rstudio/bookdown[], https://bookdown.org/[]. Very similar feature set to what we want!!! Transpiles to markdown, and then goes through Pandoc: https://bookdown.org/yihui/bookdown/pandoc.html[], thus will never run on browser without huge translation layers. But does have an obscene amount of output formats however.
* https://gohugo.io/[Hugo]. Pretty good, similar feature set to ours. But Go based, so hard on browser, and adds adhoc features on top of markdown once again
* https://en.wikipedia.org/wiki/Personal_wiki
* https://github.com/vimwiki/vimwiki
* https://github.com/hplgit/doconce
* https://www.gwern.net/About#source is pretty interesting, uses https://github.com/jaspervdj/Hakyll/ + some custom stuff.
* https://github.com/JerrySievert/bookmarkdown
* https://www.gitbook.com/
* https://github.com/rust-lang/mdBook[]. Impressive integrated search feature. Like Gitbook but implemented in Rust.
* https://github.com/facebook/docusaurus React + markdown based, written in TypeScript. So how can it be build fast? Gotta benchmark.
* vimdoc: http://vimdoc.sourceforge.net/ They do have perfectly working <internal links>, see any page e.g. http://vimdoc.sourceforge.net/htmldoc/pattern.html[].
* typst: https://github.com/typst/typst An attempt at a LaTeX killer. Has its own typesetting engine, does not simply transpile to LaTeX. Meant to be faster and simpler to write. No HTML output as of writing: https://github.com/typst/typst/issues/721
Less related but of interest, similar philosophy to what Ciro wants, but no explicitly reusable system:
* http://www.uprtcl.io/
* https://libretexts.org
* https://physics.info/
* https://hypertextbook.com/
* https://tutorial.math.lamar.edu/
= Motivation
{parent=Design goals}
<Ciro Santilli> developed OurBigBook to perfectly satisfy his writing style, which is basically "create one humongous document where you document everything you know about a subject so everyone can understand it, and just keep adding to it".
https://cirosantilli.com[] is the first major document that he has created in OurBigBook.
He decided to finally create this new system after having repeatedly facing limitations of Asciidoctor which were ignored/wontfixed upstream, because Ciro's writing style is not as common/targeted by Asciidoctor.
Following large documents Ciro worked extensively on:
* https://github.com/cirosantilli/china-dictatorship
* https://github.com/cirosantilli/linux-kernel-module-cheat
made the limitations of Asciidoctor clear to Ciro, and were major motivation in this work.
The key limitations have repeatedly annoyed Ciro were:
* cannot go over header level 6, addressed at: <unlimited header levels>
* the need for <split headers> to avoid one too large HTML output that will never get indexed properly by search engines, and takes a few seconds to load on any browser, which is unacceptable user experience
= OurBigBook Markup
{c}
{parent=}
= `.bigb` extension
{synonym}
{title2}
OurBigBook Markup is the https://en.wikipedia.org/wiki/Lightweight_markup_language[lightweight markup language] used in the <OurBigBook> project.
It works both on the <OurBigBook Web> dynamic website, and on <OurBigBook CLI> static websites from the command line.
<OurBigBook Markup> files use the `.bigb` extension.
= OurBigBook Markup quick start
{c}
{parent=OurBigBook Markup}
<Paragraphs> are made by simplifying adding an empty line, e.g.:
\OurBigBookExample[[
My first paragraph.
And now my second paragraph.
Third one to finish.
]]
<Headers> are created by starting the line with equal signs. The more equal signs the deeper you are, e.g.:
``
= Animal
== Mammal
=== Dog
=== Cat
== Bird
=== Pigeon
=== Chicken
``
On <OurBigBook Web>, the toplevel header of each page goes into a separate title box, so there things would just look like:
* title box: "Animal"
* body:
``
== Mammal
=== Dog
=== Cat
== Bird
=== Pigeon
=== Chicken
``
You can can use any header as a <`\H` `tag` argument>[tag] of any other header, e.g.:
``
= Animal
== Dog
{tag=Cute animal}
== Turtle
{tag=Ugly animal}
== Animal cuteness
=== Cute animal
=== Ugly animal
``
Headers have several powerful features that you can read more about under <`\H` arguments>, e.g. <`\H` `synonym` argument> and <`\H` `disambiguate` argument>.
To <internal links>[link to any of your other pages], you can use angle brackets (less than/greater than) signs:
``
I have a <cute animal>. <Birds> are too noisy.
``
Note how <internal link title inflection>[capitalization and pluralization generally just work].
To use a custom link text on a reference, use the following syntax:
``
I have a <cute animal>[furry animal]. <Birds>[feathery animals] are too noisy.
``
External links can be input directly as:
\OurBigBookExample[[
This is a great website: https://example.com
I really like https://example.com[this website].
]]
<Code blocks> are done with backticks \c[[`]]. With just one backtick, you get a code block inside the text:
\OurBigBookExample[[
The function call `f(x + 1, "abc")` is wrong.
]]
and with two ore more backticks you get a code block on its own line, and possibly with multiple code lines:
\OurBigBookExample[[
The function:
``
function f(x, s) {
return x + s
}
``
is wrong.
]]
<Mathematics> syntax is very similar to code blocks, you can just enter you LaTeX code in it:
\OurBigBookExample[[
The number $\sqrt{2}$ is irrational.
The same goes for:
$$
\frac{1}{\sqrt{2}}
$$
]]
We also have <Built-in math macros>[a bunch of predefined macros from popular packages], e.g. `\dv` from the https://mirrors.ibiblio.org/CTAN/macros/latex/contrib/physics/physics.pdf[`physics` package] for derivatives:
\OurBigBookExample[[
$$
\dv{x^2}{x} = 2x
$$
]]
You can <internal links>[refer] to specific equations like this:
\OurBigBookExample[[
As shown in <equation Very important equation>, this is true.
$$
\frac{1}{\sqrt{2}}
$$
{title=Very important equation}
]]
<Images> and <videos> are also easy to add and <internal links>[refer] to:
\OurBigBookExample[[
As shown at <image Cute chicken chick>, chicks are cute.
\Image[https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/H%C3%BChnerk%C3%BCken_02.jpg/800px-H%C3%BChnerk%C3%BCken_02.jpg?20200716091201]
{title=Cute chicken chick}
\Video[https://www.youtube.com/watch?v=j_fl4xoGTKU]
{title=Top Down 2D Continuous Game by Ciro Santilli (2018)}
]]
Images can take a bunch of options, about which you can read more about at <image arguments>. Most should be self explanatory, here is an image with a bunch of useful arguments:
\OurBigBookExample[[
\Image[https://upload.wikimedia.org/wikipedia/commons/thumb/c/c9/H%C3%BChnerk%C3%BCken_02.jpg/800px-H%C3%BChnerk%C3%BCken_02.jpg?20200716091201]
{title=Ultra cute chicken chick}
{description=
The chicken is yellow, and the hand is brown.
The background is green.
}
{border}
{height=400}
{source=https://commons.wikimedia.org/wiki/File:H%C3%BChnerk%C3%BCken_02.jpg}
]]