Skip to content

Commit

Permalink
Add JSR requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
littletof committed Apr 21, 2024
1 parent ec41b16 commit 3ba659f
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 13 deletions.
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# 🎩 charMD

[![deno badge](https://img.shields.io/badge/deno.land/x-success?logo=deno&logoColor=black&labelColor=white&color=black)](https://deno.land/x/charmd)
[![JSR](https://jsr.io/badges/@littletof/charmd)](https://jsr.io/@littletof/charmd)
[![snapper_deno](https://img.shields.io/badge/-snapper%20%F0%9F%93%B7-%230DBC79)](https://github.com/littletof/snapper)

*A simple, extendable markdown renderer for your terminal.*

> 🚧 This module is in early developement, expect breaking changes 🚧
**`charMD`** enables you to render a markdown text into a string, which printed in the terminal provides a well formatted output, instead of plain text.

![Showcase](docs/showcase.png)
Expand Down Expand Up @@ -35,6 +34,13 @@ import { renderMarkdown } from 'https://deno.land/x/charmd/mod.ts';
console.log(renderMarkdown('# Hello world 🌍!'));
```

Alternatevily you can import from [JSR](https://jsr.io/)

```ts
import { renderMarkdown } from 'jsr:@littletof/charmd';
```


### 🧩 Extensions

The module provides a way to extend it functionality with additional extensions, which can be provided in it's `options` param.
Expand Down Expand Up @@ -87,14 +93,6 @@ It has three options:

The module itself requires no permissions to run.

> If `--unstable` is provided, horizontal separators will consider the terminal's width.
<!--
|Flag| Required |Reason|
|:--|:-:|:--|
| 🚧 `--unstable` | | If provided, the horizontal separator will consider the terminals width |
-->

## Limitations

- No syntax highlight
Expand Down
32 changes: 31 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,39 @@
{
"name": "@littletof/charmd",
"version": "0.1.0",
"tasks": {
"example": "deno run example.ts",
"bundle:mdast": "deno bundle --no-check ./mdast_shimmed_dep.ts mdast-util-from-markdown@1_2_0-shimmed.js",
"docs:gen": "deno run -A ./docs/snapper.ts",
"test": "deno test --allow-read=./test"
"test": "deno test --coverage=./cov --allow-read=./test",
"coverage": "deno task test && deno coverage --html ./cov"
},
"imports": {
"@std/fmt": "jsr:@std/[email protected]",
"@std/testing": "jsr:@std/[email protected]"
},
"exports": {
".": "./mod.ts",
"./example": "./example.ts",
"./cli": "./cli.ts",
"./nodeTypes": "./nodeTypes.ts"
},
"publish": {
"include": [
"./deno.json",
"./mod.ts",
"./deps.ts",
"./generator.ts",
"./renderer.ts",
"./transformer.ts",
"./utils.ts",
"./nodeTypes.ts",
"./mdast-util-from-markdown@1_2_0-shimmed.js",
"./cli.ts",
"./example.ts",
"./README.md",
"./docs/showcase.png"
]
},
"fmt": {
"lineWidth": 120,
Expand Down
2 changes: 1 addition & 1 deletion deps.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * as colors from "https://deno.land/[email protected]/fmt/colors.ts";
export * as colors from "@std/fmt/colors";

import { gfmStrikethrough, gfmStrikethroughFromMarkdown, mdast } from "./mdast-util-from-markdown@1_2_0-shimmed.js";
export const strikethroughExt = gfmStrikethroughFromMarkdown;
Expand Down
2 changes: 1 addition & 1 deletion test/renderMarkdown.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals, equal } from "https://deno.land/[email protected]/testing/asserts.ts";
import { assertEquals, equal } from "@std/testing/asserts";
import { demoText } from "../example.ts";
import { renderMarkdown } from "../mod.ts";

Expand Down

0 comments on commit 3ba659f

Please sign in to comment.