Files: 758e433b7c3d4c10d3f23bafb07b64262514e96f / tmpl / docs / basics / publish-a-message.html.js
987 bytesRaw
1 | var page = require('../../page.part') |
2 | var com = require('../../com.part') |
3 | |
4 | module.exports = () => page({ |
5 | title: 'Publish a message', |
6 | section: 'docs', |
7 | tab: 'docs-basics', |
8 | path :'/docs/basics/publish-a-message.html', |
9 | content: ` |
10 | <h2>Publish a message</h2> |
11 | <p> |
12 | Every user has an append-only log of JSON messages, called their feed. |
13 | </p> |
14 | <p> |
15 | Use this command to publish your first message: |
16 | </p> |
17 | ${ com.code({ js: jsSnippet, bash: bashSnippet }) } |
18 | <ul class="see-also"> |
19 | <li><a href="/apis/scuttlebot/ssb.html#publish-async">Publish API</a></li> |
20 | <li><a href="/docs/message-types/post.html">Post messages</a></li> |
21 | </ul> |
22 | <p class="next"><a href="/docs/basics/read-your-log.html">Read your log</a></p> |
23 | ` |
24 | }) |
25 | |
26 | var jsSnippet = ` |
27 | sbot.publish({ |
28 | type: 'post', |
29 | text: 'Hello, world!' |
30 | }, function (err, msg) { |
31 | // 'msg' includes the hash-id and headers |
32 | }) |
33 | ` |
34 | |
35 | var bashSnippet = ` |
36 | sbot publish --type post --text "Hello, world!" |
37 | ` |
Built with git-ssb-web