Skip to content

Commit

Permalink
Merge pull request #6 from bchainhub/update/fixes-01
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
rastislavcore authored Mar 1, 2024
2 parents e9f4247 + f7562f6 commit f9d5f56
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
release:
types: [created]

permissions:
id-token: write
contents: write

jobs:
build-and-publish:
runs-on: ubuntu-latest
Expand All @@ -26,6 +30,6 @@ jobs:
run: npm run build

- name: Publish package on NPM 📦
run: npm publish --access public
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,20 @@ yarn add remark-corepass

Integrate the plugin into your Remark processing pipeline to automatically convert CorePass notations and optionally validate ICAN (International Core Asset Number) identifiers:

```javascript
const remark = require('remark');
const remarkCorepass = require('remark-corepass');

remark()
.use(remarkCorepass, { enableIcanCheck: true })
.process('Your markdown text here', (err, file) => {
if (err) throw err;
```typescript
import remark from 'remark';
import remarkCorepass from 'remark-corepass';

(async () => {
try {
const file = await remark()
.use(remarkCorepass, { enableIcanCheck: true })
.process('Your markdown text here');
console.log(String(file));
});
} catch (err) {
console.error(err);
}
})();
```

The plugin searches for CorePass notations in the format `[domain@coreid]` or `[!cb1234...@coreid]` in your markdown content, converting them into clickable links and validating ICAN identifiers when enabled.
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remark-corepass",
"version": "0.1.3",
"version": "0.1.4",
"description": "A Remark plugin to transform CorePass notations into markdown links.",
"main": "dist/index.js",
"types": "types/index.d.ts",
Expand All @@ -11,6 +11,10 @@
"dev": "node --loader ts-node/esm --inspect src/index.ts",
"start": "node --loader ts-node/esm src/index.ts"
},
"repository": {
"type": "git",
"url": "https://github.com/bchainhub/remark-corepass"
},
"files": [
"src/",
"dist/",
Expand All @@ -21,6 +25,7 @@
"keywords": [
"remark",
"plugin",
"remark-plugin",
"markdown",
"links",
"transform",
Expand Down Expand Up @@ -53,7 +58,6 @@
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.js",
"types": "./types/index.d.ts"
}
}
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "node",
"module": "Node16",
"moduleResolution": "Node16",
"outDir": "./dist",
"strict": true,
"esModuleInterop": true,
Expand Down

0 comments on commit f9d5f56

Please sign in to comment.