Files: 254c89b83aef67583e5b1b6f6cd5fdba4fb0b493 / tmpl / docs / basics / publish-a-message.html.js
790 bytesRaw
1 | var page = require('../../page.part') |
2 | var com = require('../../com.part') |
3 | |
4 | module.exports = () => page({ |
5 | section: 'docs', |
6 | tab: 'docs-basics', |
7 | path :'/docs/basics/publish-a-message.html', |
8 | content: ` |
9 | <h2>Publish a message</h2> |
10 | ${ com.code({ js: jsSnippet, bash: bashSnippet }) } |
11 | <p class="next"><a href="/docs/basics/read-the-log.html">Read the log</a></p> |
12 | <ul class="see-also"> |
13 | <li><a href="/advanced/message-schemas.html">Message schemas</a></li> |
14 | <li><a href="/advanced/linking-messages.html">Linking messages</a></li> |
15 | </ul> |
16 | ` |
17 | }) |
18 | |
19 | var jsSnippet = ` |
20 | sbot.publish({ |
21 | type: 'post', |
22 | text: 'Hello, world!' |
23 | }, function (err, msg) { |
24 | // 'msg' includes the hash-id and headers |
25 | }) |
26 | ` |
27 | |
28 | var bashSnippet = ` |
29 | sbot publish --type post --text "Hello, world!" |
30 | ` |
Built with git-ssb-web