AsciiDoc
Tables
I still find it confusing to work so here’s a TL;DR of tables.
Basic Table from Markdown
[cols="1,2", options="header", frame="all"] (1) |=== | HEADER | 2nd HEADER | 1 | stuffs 1 | 2 | stuffs 2 | 3 | stuffs 3 | 4 | stuffs 4 | 5 | stuffs 5 | 6 | stuffs 6 | 7 | stuffs 7 | 8 | stuffs 8 | 9 | stuffs 9 | 10 | stuffs 10 |===
| 1 | The cols is probably the length. |
If I want to have more columns, just add more items to columns.
1,1,1,1 would be 4 columns.
This should render as.
| HEADER | 2nd HEADER |
|---|---|
1 |
stuffs 1 |
2 |
stuffs 2 |
3 |
stuffs 3 |
4 |
stuffs 4 |
5 |
stuffs 5 |
6 |
stuffs 6 |
7 |
stuffs 7 |
8 |
stuffs 8 |
9 |
stuffs 9 |
10 |
stuffs 10 |
Code Block
Python
[source, python] (1)
----
def main():
print('test')
----
| 1 | You can remove source, and leave just the language, it still works. |
That will render it below.
def main():
print('test')
Comparisons between ****, ----, ====, and ….
This uses ****
This uses ----
test
Example 1. This uses ====
test
This uses ....
test
Admonitions
NOTE: This command can be used as ... (1)
| 1 | Refer to AsciiDoc Documentation. |
This should render as.
| This command can be used as … |
For multiple lines, use this
[NOTE] ==== Some text here ANd here ====
|
Some text here ANd here |
Types of admonitions:
-
NOTE
-
TIP
-
IMPORTANT
-
CAUTION
-
WARNING
Linking files for direct downloads
AsciiDoc’s documentation for this can be found here.
Simply use attachment$ family coordinate.
Direct Downloads
📒 repository (1)
📄 antora.yml
📂 modules
📂 HackTheBox
📂 pages
📄 index.adoc
📄 photon_lockdown.adoc
📂random
📂 attachments (2)
📂 cmsc134-machine-problem-1
📄 vuln.c (3)
📂 pages
📄 cmsc134-machine-problem-1.adoc
📄 cmsc134-machine-problem-1-sources.adoc
📄 cmsc134-machine-problem-1-writeup.adoc
📄 cmsc134-machine-problem-2.adoc
📄 cmsc134-writeups.adoc
📄 index.adoc
📂ROOT
📄 nav.adoc
📂 pages
📄 example.adoc
📄 index.adoc
📂Root-Me
📂 pages
📄 ftp_authentication.adoc
📄 index.adoc
📄 telnet_authentication.adoc
📄 twitter_authentication.adoc
| 1 | Writeups (as of 2024/05/11) |
| 2 | Add an attachments directory inside the module |
| 3 | Target attachment file |
Then link it with xref macro
xref:writeups:random:attachment$cmsc134-writeups/machine-problem-1/vuln.c[vuln.c]
It should look like this now.
This will ask you to download the file.
It is also possible to use text files as includes.
[,c] ---- include::writeups:random:attachment$cmsc134-writeups/machine-problem-1/vuln.c[] ----
// vuln.c
#include <stdio.h>
void vuln() {
char buffer[8];
gets(buffer);
}
int main() {
vuln();
while (1) {
}
}
Visit this working reference.
Linking to other parts of the document
<<_code_block, Code Block>>
This will link to Code Block.