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 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
- ## fetch from a url
23
+ ## Specifying Content
24
24
 
25
- Use a query parameter to override any existing textarea with raw text data fetched from a url:
25
+ ### local file
26
26
 
27
- Example: <https://dogfen.dayl.in/?read-only&href=https://raw.githubusercontent.com/daylinmorgan/dogfen/refs/heads/main/README.md>
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
- Note: this link also includes the `read-only` query parameter.
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
- ## shareable url
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
- Note: 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=`
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
- ### readonly
70
+ ### read-only
46
71
 
47
- If you are using read-only mode and won't need the editor append `/readonly` to the src url to get a bundle without codemirror
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
- (echo '<!doctype html><script type=module src=https://esm.sh/dogfen></script><textarea style=display:none>'; cat "$1")
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