git ssb

2+

cel / scuttlebot.io



Tree: 33d5cc54a0288b1a29b3ba744db7e476157f3eac

Files: 33d5cc54a0288b1a29b3ba744db7e476157f3eac / tmpl / docs / basics / publish-a-message.html.js

987 bytesRaw
1var page = require('../../page.part')
2var com = require('../../com.part')
3
4module.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
26var jsSnippet = `
27sbot.publish({
28 type: 'post',
29 text: 'Hello, world!'
30}, function (err, msg) {
31 // 'msg' includes the hash-id and headers
32})
33`
34
35var bashSnippet = `
36sbot publish --type post --text "Hello, world!"
37`

Built with git-ssb-web