shorthand

A simple text label expander combined with a markdown processor.

https://github.com/rsdoiel/shorthand

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.3%) to scientific vocabulary

Keywords

label-expander labels macro-language
Last synced: 6 months ago · JSON representation ·

Repository

A simple text label expander combined with a markdown processor.

Basic Info
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 10
Topics
label-expander labels macro-language
Created over 10 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation Codemeta

README.md

Project Status: Active – The project has reached a stable, usable state and is being actively developed.

Get it from the Snap Store

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 files

The supported command line options can be listed using the --help options.

shell shorthand --help Source code can be found at github.com/rsdoiel/shorthand

The project website is 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: date

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

```

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

Owner

  • Name: R. S. Doiel
  • Login: rsdoiel
  • Kind: user
  • Location: California
  • Company: California Institute of Technology

I am a human. Once upon a time I wrote music and prose. I write software.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
type: software
title: "shorthand"
abstract: "shorthand is a Go package for doing simple text replacement
and expansion. It works as a naive macro language."
authors:
  - family-names: Doiel
    given-names: Robert
    orcid: "https://orcid.org/0000-0003-0900-6903"

maintainers:
  - family-names: 
    given-names: 
    orcid: ""

repository-code: "https://github.com/rsdoiel/shorthand"
version: 0.2.2
license-url: "https://spdx.org/licenses/AGPL-3.0-or-later"
keywords: [ "text markup", "text expansion", "text macros" ]

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "description": "shorthand is a Go package for doing simple text replacement and expansion. It works as a naive macro language.",
  "name": "shorthand",
  "codeRepository": "https://github.com/rsdoiel/shorthand",
  "issueTracker": "https://github.com/rsdoiel/shorthand/issues",
  "license": "https://spdx.org/licenses/AGPL-3.0-or-later",
  "releaseNotes": "License update to AGPL 3 or later",
  "version": "0.2.2",
  "author": [
    {
      "@type": "Person",
      "givenName": "Robert",
      "familyName": "Doiel",
      "email": "rsdoiel@gmail.com",
      "@id": "https://orcid.org/0000-0003-0900-6903"
    }
  ],
  "developmentStatus": "active",
  "keywords": [
    "text markup",
    "text expansion",
    "text macros"
  ],
  "maintainer": "https://orcid.org/0000-0003-0900-6903",
  "programmingLanguage": [
    "Go"
  ]
}

GitHub Events

Total
  • Push event: 1
Last Year
  • Push event: 1

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 14
proxy.golang.org: github.com/rsdoiel/shorthand

Package shorthand provides shorthand definition and expansion. shorthand.go - A simple definition and expansion notation to use as shorthand when a template language is too much. @author R. S. Doiel, <rsdoiel@gmail.com> copyright (c) 2019 all rights reserved. Released under the BSD 2-Clause license See: http://opensource.org/licenses/BSD-2-Clause operators - assign a function with the func(vm *VirtualMachine, sm SourceMap) (SourceMap, error) signature and use RegisterOp (e.g. in the New() function) to add support to Shorthand. Package shorthand provides shorthand definition and expansion. shorthand.go - A simple definition and expansion notation to use as shorthand when a template language is too much. @author R. S. Doiel, <rsdoiel@gmail.com> copyright (c) 2019 all rights reserved. Released under the BSD 2-Clause license See: http://opensource.org/licenses/BSD-2-Clause

  • Versions: 14
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 9.5%
Average: 10.1%
Dependent repos count: 10.7%
Last synced: 6 months ago

Dependencies

go.mod go
  • github.com/caltechlibrary/cli v0.0.16
go.sum go
  • github.com/caltechlibrary/cli v0.0.16