Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
69ad504b8e | |||
75fa01d972 |
@ -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
3
bob
@ -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"
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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...
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user