sdocs-dev 1.1.0 → 1.1.1
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/bin/sdocs-dev.js +10 -8
- package/package.json +1 -1
- package/public/default.md +3 -3
package/bin/sdocs-dev.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* sdoc CLI
|
|
4
4
|
* Usage:
|
|
5
5
|
* sdoc report.md # open file in browser
|
|
6
|
-
* sdoc share report.md # shareable
|
|
6
|
+
* sdoc share report.md # copy shareable link to clipboard
|
|
7
7
|
* sdoc new # blank document in write mode
|
|
8
8
|
* cat file.md | sdoc # pipe markdown to browser
|
|
9
9
|
* sdoc # open studio with empty editor
|
|
@@ -29,14 +29,14 @@ USAGE
|
|
|
29
29
|
sdoc <file> --style Open with style panel
|
|
30
30
|
sdoc <file> --raw Open raw markdown source
|
|
31
31
|
sdoc new New blank document (write mode)
|
|
32
|
-
sdoc share <file>
|
|
33
|
-
sdoc share <file> --section "X"
|
|
32
|
+
sdoc share <file> Copy shareable link to clipboard
|
|
33
|
+
sdoc share <file> --section "X" Link with section anchor
|
|
34
34
|
sdoc schema Print the full styles schema
|
|
35
35
|
sdoc defaults Show ~/.sdocs/styles.yaml
|
|
36
36
|
sdoc defaults --reset Remove default styles
|
|
37
37
|
sdoc help Show this help
|
|
38
38
|
cat file.md | sdoc Pipe markdown from stdin
|
|
39
|
-
cat file.md | sdoc share Pipe to
|
|
39
|
+
cat file.md | sdoc share Pipe to clipboard link
|
|
40
40
|
|
|
41
41
|
MODE FLAGS
|
|
42
42
|
--read Clean reading view (default when file given)
|
|
@@ -461,16 +461,18 @@ if (require.main === module) {
|
|
|
461
461
|
section: opts.section,
|
|
462
462
|
});
|
|
463
463
|
|
|
464
|
-
// Share:
|
|
464
|
+
// Share: copy to clipboard
|
|
465
465
|
if (opts.subcommand === 'share') {
|
|
466
|
-
process.stdout.write(url + '\n');
|
|
467
466
|
try {
|
|
468
467
|
const clip = process.platform === 'darwin' ? 'pbcopy'
|
|
469
468
|
: execSync('which xclip 2>/dev/null', { encoding: 'utf-8' }).trim() ? 'xclip -selection clipboard'
|
|
470
469
|
: 'xsel --clipboard --input';
|
|
471
470
|
execSync(clip, { input: url, stdio: ['pipe', 'ignore', 'ignore'] });
|
|
472
|
-
|
|
473
|
-
|
|
471
|
+
const name = opts.file ? path.basename(opts.file) : 'stdin';
|
|
472
|
+
console.log(`\u2713 Link for ${name} copied to clipboard`);
|
|
473
|
+
} catch (_) {
|
|
474
|
+
process.stdout.write(url + '\n');
|
|
475
|
+
}
|
|
474
476
|
process.exit(0);
|
|
475
477
|
}
|
|
476
478
|
|
package/package.json
CHANGED
package/public/default.md
CHANGED
|
@@ -158,7 +158,7 @@ sdoc README.md --raw # raw mode (plain markdown source)
|
|
|
158
158
|
sdoc share README.md
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
-
This
|
|
161
|
+
This copies a shareable link to your clipboard — no browser opens, no URL printed. The entire document is compressed into the URL hash, so there's nothing to host or upload. You can also combine it with options:
|
|
162
162
|
|
|
163
163
|
```
|
|
164
164
|
sdoc share report.md --section "Results" # deep-link to a heading
|
|
@@ -171,7 +171,7 @@ Any command that outputs markdown can be piped directly into SmallDocs:
|
|
|
171
171
|
|
|
172
172
|
```
|
|
173
173
|
cat notes.md | sdoc # open in browser
|
|
174
|
-
cat notes.md | sdoc share #
|
|
174
|
+
cat notes.md | sdoc share # pipe to clipboard link
|
|
175
175
|
your-agent --output md | sdoc # pipe agent output to browser
|
|
176
176
|
```
|
|
177
177
|
|
|
@@ -204,7 +204,7 @@ Prints every available style property with its type, default value, and descript
|
|
|
204
204
|
|
|
205
205
|
The CLI is designed to work well in automated workflows. A few patterns:
|
|
206
206
|
|
|
207
|
-
- **Generate a styled doc**: have your agent write a `.md` file with YAML front matter, then `sdoc share file.md` to
|
|
207
|
+
- **Generate a styled doc**: have your agent write a `.md` file with YAML front matter, then `sdoc share file.md` to copy a shareable link
|
|
208
208
|
- **Learn the format**: `sdoc schema` gives your agent everything it needs to know about available style properties
|
|
209
209
|
- **Deep-link to context**: `sdoc share file.md --section "Heading"` creates a URL that scrolls straight to the relevant section
|
|
210
210
|
- **No auth, no API keys**: everything is client-side — the URL *is* the document
|