Compare commits

..

2 Commits

Author SHA1 Message Date
69ad504b8e updating readme + wip
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-29 15:48:50 +00:00
75fa01d972 adding inline code processing
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-29 11:04:02 +00:00
6 changed files with 17 additions and 7 deletions

View File

@ -1,7 +1,7 @@
# bob
Bob is a small static generator, for those who wants to maintain a personal
website or blog, all from the command line.
website or blog.
## Installation
@ -18,7 +18,7 @@ sudo make install
or using Docker :
```
docker pull git.simonpetit.top/simonpetit/bob:0.1.0
docker pull git.simonpetit.top/simonpetit/bob:0.1.2
```
## Usage

3
bob
View File

@ -23,8 +23,7 @@ usage()
echo "bob commands :"
echo " help display this help"
echo " init initiate a blog"
echo " publish <post> publish the post"
echo " unpublish <post> unpublish the post"
echo " publish publishes all published drafts"
}

View File

@ -61,6 +61,13 @@ function replaceInline(line, result, start, end) {
line = substr(line, 1, start-1) "<a href=\"" matched_url "\">" matched_link "</a>" substr(line, end+1)
}
# Replace occurences of `...` with <code>...</code>
while (match(line, /`(.+)`/)) {
start = RSTART
end = RSTART + RLENGTH - 1
line = substr(line, 1, start-1) "<code>" substr(line, start+1, RLENGTH-2) "</code>" substr(line, end+1)
}
return line
}
@ -135,7 +142,7 @@ function closeOne() {
# Matching a simple paragraph
!/^(#|\*|-|\+|>|`|$|\t| )/ {
!/^(#|\*|-|\+|>|$|\t| )/ {
env = last()
if (env == "none") {
# If no block, print a paragraph

View File

@ -14,4 +14,4 @@
{{articles}}
</body>
</html>
</html>

View File

@ -16,4 +16,4 @@
</article>
</body>
</html>
</html>

View File

@ -116,6 +116,10 @@ declare -a tests=(
"A link to [wikipedia](https://www.wikipedia.org)"
"<p>A link to <a href=\"https://www.wikipedia.org\">wikipedia</a></p>"
"Inline code"
$'`a code block`'
"<p><code>a code block</code></p>"
# You can add more test cases following the same format...
)