{"_id":"@a-morphous/at-shorthand","name":"@a-morphous/at-shorthand","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@a-morphous/at-shorthand","version":"1.0.0","description":"A format for metadata that decorates a single line of text. Can be converted into HTML classes and ids, which then are presented in JSON form.","main":"dist/index.js","type":"module","keywords":[],"author":"","license":"ISC","devDependencies":{"esbuild":"^0.17.19","expect":"^29.5.0","minimist":"^1.2.8","npm-dts":"^1.3.12"},"scripts":{"build":"node build","dryRun":"pnpm publish --dry-run","pub":"pnpm publish --access public","test":"node test/at-shorthand.spec.js"},"types":"./dist/index.d.ts","_id":"@a-morphous/at-shorthand@1.0.0","_integrity":"sha512-JdC0JG4/Q+Vy7TCen0MsN+99m8zkQxLCpyH0eKUjDzcdxhRQG9BjNGD+y1dPFxVUMH+9cf38HUdRDOSjRh5zeg==","_resolved":"/private/var/folders/pd/2r2pf8ln2cv61g2b_k9fr5nc0000gn/T/b6fd6b77544942ea5c440c5ce0beb3d3/a-morphous-at-shorthand-1.0.0.tgz","_from":"file:a-morphous-at-shorthand-1.0.0.tgz","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-JdC0JG4/Q+Vy7TCen0MsN+99m8zkQxLCpyH0eKUjDzcdxhRQG9BjNGD+y1dPFxVUMH+9cf38HUdRDOSjRh5zeg==","shasum":"1b5c1464b24c572517fc1b1b0fc89ed6de3bc41f","tarball":"https://registry.npmjs.org/@a-morphous/at-shorthand/-/at-shorthand-1.0.0.tgz","fileCount":6,"unpackedSize":7579,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGCpL+h6tNrAXNJbq9INFF59HkFExhYkmzdiHNYCfxjnAiBX9L/iKRt6FUzgZaOKUV/0zCIlMNt4HD6j2GePf4nbwQ=="}]},"_npmUser":{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"},"directories":{},"maintainers":[{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/at-shorthand_1.0.0_1685073041745_0.4569451316640465"},"_hasShrinkwrap":false}},"time":{"created":"2023-05-26T03:50:41.658Z","1.0.0":"2023-05-26T03:50:41.926Z","modified":"2023-05-26T03:50:42.122Z"},"maintainers":[{"name":"amorphous","email":"84998015+a-morphous@users.noreply.github.com"}],"description":"A format for metadata that decorates a single line of text. Can be converted into HTML classes and ids, which then are presented in JSON form.","keywords":[],"license":"ISC","readme":"# at-shorthand\n\nA format for metadata that decorates a single line of text. Can be converted into HTML classes and ids, which then are presented in JSON form.\n\n## Usage\n\n```js\nimport { parseAtShorthandLine } from '@a-morphous/at-shorthand'\n\nconst jsonLine = parseAtShorthandLine(string)\n```\n\n## Format\n\n@ shorthand is separated from the rest of the text content by a space, or a colon and a space:\n\n```\n@metadata This is regular prose.\n@metadata2: The colon is optional.\n```\n\nLike in HTML, these identifiers are called `classes`.\n\nDifferent classes are separated by `.` in the @ shorthand.\n\n```\n@tag1.tag2 This text has two tags attached to it.\n```\n\nA class starting with `#` is instead rendered as an id:\n\n```\n@#id Ids have a special field in the parsed JSON, and are always set to the primary field of the JSON over classes.\n@#id.class You can mix Ids and classes.\n@class.#id or put them in any order.\n```\n\nA line can have any number of classes, but only one id.\n\n## Output Format\n\n```js\n{\n\tclasses: string[] // list of classes in order\n\tid: string // an id, if the line had one\n\tprimary: string // the id if it exists, else the first class\n\ttext: string // the rest of the line\n}\n```","readmeFilename":"README.md"}