dogfen 2026.1022.0 → 2026.1024.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -9
- package/dist/dogfen.js +2020 -1354
- package/dist/dogfen.katex.min.js +103 -96
- package/dist/dogfen.katex.readonly.min.js +109 -102
- package/dist/dogfen.min.js +109 -102
- package/dist/dogfen.readonly.min.js +98 -91
- package/package.json +10 -18
package/README.md
CHANGED
|
@@ -20,21 +20,46 @@ or start writing a [new](https://dogfen.dayl.in/new) one!
|
|
|
20
20
|
|
|
21
21
|
See a [demo](https://dogfen.dayl.in/demo) of (some) of the supported syntax.
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Specifying Content
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
### local file
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
As shown above to render a document you should prepend it with the following line, taking care to ensure the content is in the `<textarea>` and open in a browser:
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
```html
|
|
30
|
+
<!doctype html><script type=module src=https://esm.sh/dogfen></script><textarea style=display:none>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If you want to modify the content using a different editor but still preview in your browser add the `live` attribute to the `<textarea>` (optionally, you can provide a value for the attribute in seconds to set the polling rate, by default it's 2.5s):
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<!doctype html><script type=module src=https://esm.sh/dogfen></script><textarea style=display:none live read-only>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### fetch from href
|
|
30
40
|
|
|
31
|
-
|
|
41
|
+
Use a query parameter to set the content with the raw text data fetched from a url:
|
|
42
|
+
|
|
43
|
+
Example: <https://dogfen.dayl.in/read-only?href=https://raw.githubusercontent.com/daylinmorgan/dogfen/refs/heads/main/README.md>
|
|
44
|
+
|
|
45
|
+
> [!Note]
|
|
46
|
+
> This base url (<https://dogfen.dayl.in/read-only>) loads a lighter bundle (without codemirror), you could also specifying this with a query parameter (`?read-only`)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### shareable url
|
|
32
50
|
|
|
33
51
|
It's also possible to generate shareable urls:
|
|
34
52
|
|
|
35
53
|
Example: <https://dogfen.dayl.in?raw#BYUwNmD2AEDukCcwBMg>
|
|
36
54
|
|
|
37
|
-
|
|
55
|
+
> [!NOTE]
|
|
56
|
+
> This has the typical caveats of embedding data in a url, i.e. for big documents host the data at a public link and use `?href=`
|
|
57
|
+
|
|
58
|
+
### code
|
|
59
|
+
|
|
60
|
+
If you wish to share a code snippet rather than markdown you may use the `code={lang}` attribute or query parameter to treat the entire document as a code snippet
|
|
61
|
+
|
|
62
|
+
Example: <https://dogfen.dayl.in/read-only?code=nim&href=https://raw.githubusercontent.com/daylinmorgan/dogfen/refs/heads/main/src/dogfen.nim>
|
|
38
63
|
|
|
39
64
|
## alternative versions
|
|
40
65
|
|
|
@@ -42,9 +67,9 @@ Note: this has the typical caveats of embedding data in a url, i.e. for big docu
|
|
|
42
67
|
|
|
43
68
|
If you need support for katex rendering append `/katex` to the src url to get a bundle with katex
|
|
44
69
|
|
|
45
|
-
###
|
|
70
|
+
### read-only
|
|
46
71
|
|
|
47
|
-
If you are using read-only mode and won't need the editor append `/
|
|
72
|
+
If you are using read-only mode and won't need the editor append `/read-only` (or `/katex/read-only`) to the src url to get a bundle without codemirror
|
|
48
73
|
|
|
49
74
|
## converter
|
|
50
75
|
|
|
@@ -52,7 +77,8 @@ You could define a shell helper function to quickly convert a markdown doc to a
|
|
|
52
77
|
|
|
53
78
|
```sh
|
|
54
79
|
dogfen() {
|
|
55
|
-
|
|
80
|
+
echo '<!doctype html><script type=module src=https://esm.sh/dogfen></script><textarea style=display:none>'
|
|
81
|
+
[ -z "$1"] && cat "$1"
|
|
56
82
|
}
|
|
57
83
|
```
|
|
58
84
|
|