Files: c0c9508d732a53b79ef287fd75268ac0d50dda3a / tmpl / docs / basics / publish-a-message.html.js
1044 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 | Let's start your feed by telling the world, hello! |
14 | </p> |
15 | <p> |
16 | Use this command to publish your first message: |
17 | </p> |
18 | ${ com.code({ js: jsSnippet, bash: bashSnippet }) } |
19 | <ul class="see-also"> |
20 | <li><a href="/apis/scuttlebot/ssb.html#publish-async">Publish API</a></li> |
21 | <li><a href="/docs/message-types/post.html">Post messages</a></li> |
22 | </ul> |
23 | <p class="next"><a href="/docs/basics/read-your-log.html">Read your log</a></p> |
24 | ` |
25 | }) |
26 | |
27 | var jsSnippet = ` |
28 | sbot.publish({ |
29 | type: 'post', |
30 | text: 'Hello, world!' |
31 | }, function (err, msg) { |
32 | // 'msg' includes the hash-id and headers |
33 | }) |
34 | ` |
35 | |
36 | var bashSnippet = ` |
37 | sbot publish --type post --text "Hello, world!" |
38 | ` |
Built with git-ssb-web