Convert note panels

This commit is contained in:
Rawiri Blundell 2023-04-17 13:29:50 +12:00
parent 407c77115e
commit 343ea997f3
10 changed files with 55 additions and 22 deletions

View File

@ -141,7 +141,11 @@ extract_markup() {
# scrape_targets **/*.markup | sort | uniq
while read -r; do
scrape_targets "${REPLY}"
done < <(find . -name "*.markup") | sort | uniq > raw_targets
done < <(find . -name "*.markup") | sort | uniq > fresh_targets
while read -r; do
prepend "https://wiki.bash-hackers.org" "${REPLY}"
done < fresh_targets > raw_targets
# And as before, we generate a list of targets and retrieve them
while read -r; do
@ -157,3 +161,20 @@ extract_markup() {
pandoc --from dokuwiki --to gfm --toc --no-highlight "${REPLY}" > "${REPLY/.markup/}.md"
done < <(find . -name "*.markup")
)
# Ugh, screw the constant while read loops. Let's extglob from here.
# Replace <note important>
sed -i -e 's/\\<note important\\>/\| :loudspeaker: /' ./**/*.md
# Replace <note info>
sed -i -e 's/\\<note info\\>/\| :memo: /' ./**/*.md
# Replace <note tip>
sed -i -e 's/\\<note tip\\>/\| :bulb: /' ./**/*.md
# Replace <note warning>
sed -i -e 's/\\<note warning\\>/\| :warning: /' ./**/*.md
# Replace </note>
sed -i -e 's/\\<\/note\\>/ |\n| --- |/' ./**/*.md

View File

@ -6,7 +6,8 @@
(4.3 will come soon), I consider it to be "standard". This page is not
maintained anymore and is left here to keep your links working. See the
[bashchanges](/scripting/bashchanges) page for new stuff
introduced.\</note\>
introduced. |
| --- |
Besides many bugfixes since Bash 3.2, Bash 4 will bring some interesting
new features for shell users and scripters. See also

View File

@ -57,7 +57,7 @@ argument!).
The `-v` Option can't assign directly to array indexes in Bash versions
older than Bash 4.1.
\<note warning\> In versions newer than 4.1, one must be careful when
| :warning: In versions newer than 4.1, one must be careful when
performing expansions into the first non-option argument of printf as
this opens up the possibility of an easy code injection vulnerability.
@ -70,7 +70,8 @@ If you must, either specify a hard-coded format string or use -- to
signal the end of options. The exact same issue also applies to
[read](commands/builtin/read), and a similar one to
[mapfile](commands/builtin/mapfile), though performing expansions into
their arguments is less common. \</note\>
their arguments is less common. |
| --- |
### Arguments
@ -96,7 +97,7 @@ Take care to avoid [word splitting](/syntax/expansion/wordsplit), as
accidentally passing the wrong number of arguments can produce wildly
different and unexpected results. See [this article](/syntax/words).
\<note warning\> <u>**Again, attention:**</u> When a numerical format
| :warning: <u>**Again, attention:**</u> When a numerical format
expects a number, the internal `printf`-command will use the common Bash
arithmetic rules regarding the base. A command like the following
example **will** throw an error, since `08` is not a valid octal number
@ -104,7 +105,8 @@ example **will** throw an error, since `08` is not a valid octal number
printf '%d\n' 08
\</note\>
|
| --- |
### Format strings

View File

@ -212,9 +212,10 @@ Similarly for output file descriptors, writing a line to file descriptor
`s` will append a line to a file as will writing a line to file
descriptor `t`.
\<note tip\>The syntax is somewhat confusing in that you would think
| :bulb: The syntax is somewhat confusing in that you would think
that the arrow would point in the direction of the copy, but it's
reversed. So it's `target>&source` effectively.\</note\>
reversed. So it's `target>&source` effectively. |
| --- |
So, as a simple example (albeit slightly contrived), is the following:

View File

@ -345,9 +345,10 @@ Why? Because when printed literally, the `^M` makes the cursor go back
to the beginning of the line. The whole error message is *printed*, but
you *see* only part of it!
\<note warning\> It's easy to imagine the `^M` is bad in other places
| :warning: It's easy to imagine the `^M` is bad in other places
too. If you get weird and illogical messages from your script, rule out
the possibility that`^M` is involved. Find and eliminate it! \</note\>
the possibility that`^M` is involved. Find and eliminate it! |
| --- |
### How can I find and eliminate them?

View File

@ -431,8 +431,9 @@ version \<WRAP column 40%\>
## Dictionary
\<note tip\>A list of expressions, words, and their meanings is
[here](/dict/index).\</note\>
| :bulb: A list of expressions, words, and their meanings is
[here](/dict/index). |
| --- |
## Links

View File

@ -131,7 +131,8 @@ As of now, arrays can't be exported.
\<note\> For completeness and details on several parameter expansion
variants, see the [article about parameter expansion](/syntax/pe) and
check the notes about arrays. \</note\>
check the notes about arrays. |
| --- |
| Syntax | Description |
|-----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@ -217,7 +218,7 @@ It is best to [explicitly specify
-v](commands/builtin/unset#portability_considerations) when unsetting
variables with unset.
\<note warning\> Specifying unquoted array elements as arguments to any
| :warning: Specifying unquoted array elements as arguments to any
command, such as with the syntax above **may cause [pathname
expansion](/syntax/expansion/globs) to occur** due to the presence of
glob characters.
@ -237,7 +238,8 @@ To avoid this, **always quote** the array name and index:
unset -v 'x[1]'
This applies generally to all commands which take variable names as
arguments. Single quotes preferred. \</note\>
arguments. Single quotes preferred. |
| --- |
## Usage
@ -407,7 +409,8 @@ valid assignment. If so, they are evaluated as assignments. If not, they
are undergo normal argument expansion before being passed to the builtin
which evaluates the resulting string as an assignment (somewhat like
`eval`, but there are differences.) `'Todo:`' Discuss this in detail.
\</note\>
|
| --- |
### Indirection

View File

@ -30,7 +30,7 @@ from a file).
### Scope
\<note important\> Note: According to multiple comments and sources, the
| :loudspeaker: Note: According to multiple comments and sources, the
scope of process substitution file descriptors is **not** stable,
guaranteed, or specified by bash. Newer versions of bash (5.0+) seem to
have shorter scope, and substitutions scope seems to be shorter than
@ -39,7 +39,8 @@ function scope. See
and
[stackoverflow](https://stackoverflow.com/questions/46660020/bash-what-is-the-scope-of-the-process-substitution);
the latter discussion contains a script that can test the scoping
behavior case-by-case \</note\>
behavior case-by-case |
| --- |
If a process substitution is expanded as an argument to a function,
expanded to an environment variable during calling of a function, or

View File

@ -33,13 +33,14 @@ Tilde expansion is also performed everytime a variable is assigned:
- after **every** `:` (colon) in the assigned value:
`TARGET=file:~moonman/share`
\<note info\> As of now (Bash 4.3-alpha) the following constructs
| :memo: As of now (Bash 4.3-alpha) the following constructs
**also** works, though it's not a variable assignment:
echo foo=~
echo foo=:~
I don't know yet, if this is a bug or intended. \</note\>
I don't know yet, if this is a bug or intended. |
| --- |
This way you can correctly use the tilde expansion in your
[PATH](/syntax/shellvars#PATH):

View File

@ -11,10 +11,11 @@ Responsible for site content and design:
`Jan Schampera Erich-Schott-Str. 2 95666 Mitterteich Federal Republic of Germany`
\<note warning\>*"I am not responsible for contents of linked pages. I
| :warning: *"I am not responsible for contents of linked pages. I
dissociate myself from illegal contents, especially child porn, any
radical statements, picture material as well as illegal links. The
webmasters of linked pages are responsible by themselves! I assure my
users of trying to link only serious pages, and of checking my links
first. But at least I can not guarantee for unknown people and their
thoughts."*\</note\>
thoughts."* |
| --- |