From 4c6e1e9c4775da020764801000d895ff146fdbd6 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Fri, 24 Jan 2025 02:03:07 +0100 Subject: [PATCH] fix(documentation): Improved and updated README with detailed usage instructions --- README.md | 63 ---------------------------------------- changelog.md | 7 +++++ npmextra.json | 19 ++++++++++-- package.json | 18 ++++++++++-- ts/00_commitinfo_data.ts | 4 +-- ts/index.ts | 2 +- 6 files changed, 42 insertions(+), 71 deletions(-) delete mode 100644 README.md diff --git a/README.md b/README.md deleted file mode 100644 index a1d3547..0000000 --- a/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# @push.rocks/smartfm -frontmatter done right - -> Please consider following us on https://beta.news/lossless to subscribe to infos on changes and updates. - -## Availabililty and Links -* [npmjs.org (npm package)](https://www.npmjs.com/package/@push.rocks/smartfm) -* [gitlab.com (source)](https://gitlab.com/pushrocks/smartfm) -* [github.com (source mirror)](https://github.com/pushrocks/smartfm) -* [docs (typedoc)](https://pushrocks.gitlab.io/smartfm/) - -## Status for master -[![build status](https://gitlab.com/pushrocks/smartfm/badges/master/build.svg)](https://gitlab.com/pushrocks/smartfm/commits/master) -[![coverage report](https://gitlab.com/pushrocks/smartfm/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartfm/commits/master) -[![npm downloads per month](https://img.shields.io/npm/dm/@push.rocks/smartfm.svg)](https://www.npmjs.com/package/@push.rocks/smartfm) -[![Known Vulnerabilities](https://snyk.io/test/npm/@push.rocks/smartfm/badge.svg)](https://snyk.io/test/npm/@push.rocks/smartfm) -[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) -[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) -[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/) - -## Usage - -We recommend TypeScript for best in class Intellisense. - -```javascript -import * as smartfm from * smartfm - -let markdownfile = `--- -testKey: testValue -testKey2: testValue2 ---- -# some markdown` - -// easy methods -let parsedData = smartfm.parse(markdownfile) - -// parsedData will be object -/* - { - data: { - testKey: testValue, - testKey2: testValue2 - }, - content: '# some markdown', - orig: '---\ntestKey: testValue\ntestKey2: testValue2\n---\n# some markdown' - } -*/ - -let newFmString = smartfm.stringify('My awesome string', {testKey1: testValue1}) -// newFmString will be '---\testKey1: testValue1\n---\nMyawesomeString' - -# class Smartfm -let mySmartfm = new smartfm.Smartfm({ - fmType: 'yaml' // can be yaml or json atm -}) -``` - -For further information read the linked docs at the top of this readme. - -> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) -| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) - -[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com) diff --git a/changelog.md b/changelog.md index 57f3c28..17e59a7 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2025-01-24 - 2.1.1 - fix(documentation) +Improved and updated README with detailed usage instructions + +- Replaced placeholder text in README with complete usage guide +- Added comprehensive examples for parsing and stringifying frontmatter data +- Included detailed instructions on how to install and use the Smartfm class + ## 2025-01-23 - 2.1.0 - feat(ci) Introduce new CI workflows for Gitea and remove GitLab CI diff --git a/npmextra.json b/npmextra.json index 5017bea..0036232 100644 --- a/npmextra.json +++ b/npmextra.json @@ -9,9 +9,24 @@ "githost": "code.foss.global", "gitscope": "push.rocks", "gitrepo": "smartfm", - "description": "frontmatter done right", + "description": "A Node.js module for handling and processing frontmatter in markdown and text files, leveraging the gray-matter library for parsing and stringifying YAML or JSON formatted frontmatter.", "npmPackagename": "@push.rocks/smartfm", - "license": "MIT" + "license": "MIT", + "keywords": [ + "frontmatter", + "markdown", + "text files", + "YAML", + "JSON", + "stringify", + "parse", + "commented sections", + "static site generator", + "CMS", + "content metadata", + "metadata management", + "gray-matter" + ] } }, "tsdoc": { diff --git a/package.json b/package.json index 374de34..32ec193 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@push.rocks/smartfm", "version": "2.1.0", "private": false, - "description": "frontmatter done right", + "description": "A Node.js module for handling and processing frontmatter in markdown and text files, leveraging the gray-matter library for parsing and stringifying YAML or JSON formatted frontmatter.", "exports": { ".": "./dist/index.js" }, @@ -17,7 +17,19 @@ "url": "git+https://code.foss.global/push.rocks/smartfm.git" }, "keywords": [ - "frontmatter" + "frontmatter", + "markdown", + "text files", + "YAML", + "JSON", + "stringify", + "parse", + "commented sections", + "static site generator", + "CMS", + "content metadata", + "metadata management", + "gray-matter" ], "author": "Lossless GmbH", "license": "MIT", @@ -47,4 +59,4 @@ "npmextra.json", "readme.md" ] -} +} \ No newline at end of file diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 99dff4c..65f606c 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartfm', - version: '2.1.0', - description: 'frontmatter done right' + version: '2.1.1', + description: 'A Node.js module for handling and processing frontmatter in markdown and text files, leveraging the gray-matter library for parsing and stringifying YAML or JSON formatted frontmatter.' } diff --git a/ts/index.ts b/ts/index.ts index ff376ce..c164c97 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -31,7 +31,7 @@ export class Smartfm { } /** - * parse from commnets + * parse from comments */ parseFromComments(commentStart: string, stringToParse: string) { const diffFunc = (diffMe, diffBy) => diffMe.split(diffBy).join('');