Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rsdoiel/shorthand
A simple text label expander combined with a markdown processor.
https://github.com/rsdoiel/shorthand
label-expander labels macro-language
Last synced: 13 days ago
JSON representation
A simple text label expander combined with a markdown processor.
- Host: GitHub
- URL: https://github.com/rsdoiel/shorthand
- Owner: rsdoiel
- License: agpl-3.0
- Created: 2015-08-29T17:46:47.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T19:47:41.000Z (2 months ago)
- Last Synced: 2024-10-26T05:42:02.394Z (2 months ago)
- Topics: label-expander, labels, macro-language
- Language: Go
- Homepage: http://rsdoiel.github.io/shorthand
- Size: 4.64 MB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.cff
- Codemeta: codemeta.json
Awesome Lists containing this project
README
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-white.svg)](https://snapcraft.io/shorthand)
# shorthand
A simple label or macro expander
Example use cases:
+ label or abbreviation expansion in Markdown files
+ build html templates from markdown files
+ compose pages from multiple markdown filesThe supported command line options can be listed using the _--help_
options.```shell
shorthand --help
```
Source code can be found at [github.com/rsdoiel/shorthand](https://github.com/rsdoiel/shorthand)The project website is [rsdoiel.github.io/shorthand](http://rsdoiel.github.io/shorthand)
## Tutorial
### Timestamp in Markdown file
If the content of the markdown file _testdata/report.md_ was
```markdown
Report Date: @now
# Topic: The current local time.
This report highlights the current local time of rendering this document
The current local time is @now
```
From the command line you can do something like this
```shell
shorthand -e ':bash: @now date' \
-e ":import: @report testdata/report.md" \
-e "@report" \
-e ':exit:' | pandoc -s > testdata/report.html
```What this command does is launch the _shorthand_ interpreter and it
replaces all occurrences of "@now" in the markdown document with the
output from the Unix program _date_.The output (before piping to Pandoc) would look something like
```html
Report Date: Sat Aug 29 11:25:48 PDT 2015# Topic: The current local time.
This report highlights the current local time of rendering this document
The current local time is Sat Aug 29 11:25:48 PDT 2015
```Notice that both "@now" are replace with the same date information.
### embedding shorthand definitions
You could also embed the shorthand definitions command straight in the
markdown itself. with something like```markdown
@now :bash: dateReport Date: @now
# Topic: The current local time.
This report highlights the current local time of rendering this document
The current local time is @now
```
That makes the command line a little shorter
```shell
shorthand testdata/report.md | pandoc -s > testdata/report.html
```## Installation
_shorthand_ can be installed with the *go get* command.
```
go get github.com/rsdoiel/shorthand/...
```## Documentation
- [shorthand](shorthand.html)
- [shorthand syntax](shorthand-syntax)