Coder Social home page Coder Social logo

mattermost / mattermost-developer-documentation Goto Github PK

View Code? Open in Web Editor NEW
79.0 38.0 382.0 57.97 MB

Mattermost developer documentation.

Home Page: https://developers.mattermost.com

License: BSD 3-Clause "New" or "Revised" License

HTML 30.50% CSS 39.80% JavaScript 11.42% Makefile 0.39% Go 3.18% Shell 14.71%
documentation developer hacktoberfest

mattermost-developer-documentation's Introduction

Mattermost developer documentation Mattermost dev docs status badge

Website for Mattermost developer documentation, built using Hugo. The master branch is continuously deployed to developers.mattermost.com.

Contribute

Prerequisites

Set up your environment

  1. Follow the Hugo documentation to install Hugo. This repo uses Hugo v0.101.0 to build the docs.

    # For example, on macOS:
    brew install hugo
    
    # Snapcraft on Linux:
    snap install hugo
    
    # or using golang directly:
    go install github.com/gohugoio/[email protected]
  2. Fork the repository and clone the fork to your machine. Change directories to the cloned repo when it has finished.

    git clone [email protected]:<yourgithubname>/mattermost-developer-documentation.git
    cd mattermost-developer-documentation
  3. Generate JSON plugin docs; this must be done at least once.

    make plugin-data
  4. Start the Hugo development server.

    make run
  5. Open http://localhost:1313 in a new browser tab to see the docs

You're all set! You can start making changes as desired; the development server will automatically re-render affected docs pages.

Note: Before pushing changes to your fork, run a full build of the docs using make dist to make sure there are no build errors.

Best practices

  • The Mattermost developer documentation uses several custom Hugo shortcodes to control its presentation. Shortcodes are preferred over using raw HTML and should be used where possible.
  • Links that navigate away from developers.mattermost.com should use the newtabref shortcode.

Hugo shortcodes

Collapse

The collapse shortcode creates a collapsible text box.

{{<collapse id="client_bindings_request" title="Client requests bindings from server">}}
`GET /plugins/com.mattermost.apps/api/v1/bindings?user_id=ws4o4macctyn5ko8uhkkxmgfur&channel_id=qphz13bzbf8c7j778tdnaw3huc&scope=webapp`
{{</collapse>}}

Example of collapse shortcode

Note that the id attribute of the shortcode must be unique on the page.

Compass icon

The compass-icon shortcode displays an icon from the Compass Icon set. The shortcode takes 2 arguments: the ID of the icon and an optional icon description which is used as alt text.

{{<compass-icon icon-star "Mandatory Value">}}

Example of compass-icon shortcode

Mermaid

The mermaid shortcode allows embedding Mermaid diagram syntax into the page. Each page that uses a Mermaid diagram must also have a mermaid: true property set in the page's frontmatter.

{{<mermaid>}}
sequenceDiagram
    actor System Admin
    System Admin->>Mattermost server: install app
    Mattermost server->>Apps framework: install app
    Apps framework->>App: request manifest
    App->>Apps framework: send manifest
    Apps framework->>System Admin: request permissions
    System Admin->>Apps framework: grant permissions
    Apps framework->>Mattermost server: create bot
    Apps framework->>Mattermost server: create OAuth app
    Apps framework->>Apps framework: enable app
    Apps framework->>App: call OnInstall if defined
{{</mermaid>}}

Example of Mermaid shortcode

Open links in a new tab

The newtabref shortcode creates a link that opens in a new browser tab. The link text is followed by a Compass Icon which indicates the link will open in a new tab.

All Apps should define a manifest ({{<newtabref title="godoc" href="https://pkg.go.dev/github.com/mattermost/mattermost-plugin-apps/apps#Manifest">}}) as a JSON object.

Example of newtabref shortcode

Note

The note shortcode displays a styled message box suitable for a note. The shortcode accepts 3 arguments: the title of the node, an optional Compass Icon ID, and an optional description for the Compass Icon.

{{<note "Mandatory values" "icon-star" "Mandatory Value">}} 
- The `app_id` and `homepage_url` values must be specified.
- At least one deployment method - `aws_lambda`, `open_faas`, or `http` - must be specified.
{{</note>}}

Example of note shortcode

Tabbed content

A combination of the tabs and tab shortcodes create a section of tabbed content. The tabs shortcode defines the list of available tabs in the tab "selection bar", each with a unique ID and name. The tab shortcode defines the content for an individual tab.

Example of using tabbed content shortcodes:

{{<tabs "tab_group_name" "tabid1,tabname1;tabid2,tabname2;..." "initial_tab_id">}}
{{<tab "tabid1" "display: block;">}}
- Content for tab #1
{{</tab>}}
{{<tab "tabid2">}}
- Content for tab #2
{{</tab>}}
tabs shortcode

The tabs shortcode creates the top portion of tabbed content: a list of available tabs, each with a click handler.

The general format of the shortcode is:

{{<tabs "tab_group_name" "list_of_available_tabs" "initial_tab_id">}}

To ensure tabs in one group don't affect another group, a unique tab_group_name is required. The available tabs in the group are defined in a single string of the format:

tab1_id,tab1_name;tab2_id,tab2_name;...

The following example defines a group of two tabs named Android and iOS:

{{<tabs "mobile" "mobile-droid,Android;mobile-ios,iOS" "mobile-droid">}}

The initial_tab_id specifies the ID of the tab that should be active when the page loads.

tab shortcode

The tab shortcode defines a section of content for a specific tab.

The general format of the shortcode is:

{{<tab "tab_id" "initial_tab_style">}}
...tab content defined here...
{{</tab>}}

The tab_id must correspond to a tab ID defined in a tabs shortcode. The initial_tab_style is used to display the initial active tab's content by specifying a value of display: block;.

The following example defines content for two tabs with IDs tab1_id and tab2_id:

{{<tab "tab1_id" "display: block;">}}
- Content for tab #1
{{</tab>}}
{{<tab "tab2_id">}}
- Content for tab #2
{{</tab>}}
Limitations of tabbed content

Due to the implementation of the tab shortcode, there are some limitations on what information can be rendered:

  • note shortcodes cannot contain bulleted lists

mattermost-developer-documentation's People

Contributors

aaronrothschild avatar agarciamontoro avatar agnivade avatar amyblais avatar ccbrown avatar comharris avatar cpanato avatar crspeller avatar cwarnermm avatar devinbinnie avatar emdecr avatar enahum avatar grundleborg avatar hanzei avatar hmhealey avatar jasonblais avatar jaydeland avatar jfrerich avatar justinegeffen avatar jwilander avatar larkox avatar lieut-data avatar metanerd avatar mickmister avatar mkraft avatar musikpolice avatar neflyte avatar rutam21 avatar saturninoabril avatar varghesejose2020 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mattermost-developer-documentation's Issues

Add dep ensure before starting mattemost server

it seems that we must use dep ensure before make run to start mattermost server, other way it tell me a package is missing.
actual error:
`cmd/mattermost/main.go:9:2: cannot find package "github.com/mattermost/mattermost-server
/cmd/mattermost/commands" in any of:
/home/wsebai/go/src/mattermost-server/vendor/github.com/mattermost/mattermost-server/cmd/mattermost/commands (vendor tree)
/usr/lib/go/src/github.com/mattermost/mattermost-server/cmd/mattermost/commands (from $GOROOT)
/home/wsebai/go/src/github.com/mattermost/mattermost-server/cmd/mattermost/commands (from $GOPATH)

cmd/mattermost/main.go:15:2: cannot find package "github.com/mattermost/mattermost-server/imports" in any of:
/home/wsebai/go/src/mattermost-server/vendor/github.com/mattermost/mattermost-server/imports (vendor tree)
/usr/lib/go/src/github.com/mattermost/mattermost-server/imports (from $GOROOT)
/home/wsebai/go/src/github.com/mattermost/mattermost-server/imports (from $GOPATH)

cmd/mattermost/main.go:12:2: cannot find package "github.com/mattermost/mattermost-server/model/gitlab" in any of:
/home/wsebai/go/src/mattermost-server/vendor/github.com/mattermost/mattermost-server/model/gitlab (vendor tree)
/usr/lib/go/src/github.com/mattermost/mattermost-server/model/gitlab (from $GOROOT)
/home/wsebai/go/src/github.com/mattermost/mattermost-server/model/gitlab (from $GOPATH)
`

Document help wanted issue creation process

Contributions without tickets, including raising a proposal for a help wanted issue, are documented here

https://developers.mattermost.com/contribute/getting-started/contributions-without-ticket/

However, core committer process for creating these Help Wanted issues is not documented. Propose we do so. The process is roughly:

  1. Create a Jira issue with a clear title and description, including any information that would help a contributor get started.
  2. If applicable, have the issue reviewed by a PM or another core committer
  3. Add "Help Wanted" fix version, which automatically creates a Help Wanted GitHub issue for that Jira issue. This automation is done via the Zapier tool.
  4. Follow up on questions from contributors on the help wanted issue

Note: As of August 6, the Zapier automation is broken due to an issue on Zapier's end. Hence, you will need to create the issue manually on step 3. For an example issue with an intro that helps new contributors to get started can be found here: mattermost/mattermost#11675

Mailing list

Need to add a mailing list sign-up form that gets notified about new blog posts. Must have a way to unsubscribe.

my build dot work

i build my android apk (via make build-android), but i see only spash screen

java.lang.RuntimeException: Unable to load script from assets 'index.android.bundle'. Make sure your bundle is packaged correctly or you're running a packager server.
   at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)
   at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets(CatalystInstanceImpl.java:216)
   at com.facebook.react.bridge.JSBundleLoader$1.loadScript(JSBundleLoader.java:32)
   at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:243)
   at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1116)
   at com.facebook.react.ReactInstanceManager.access$900(ReactInstanceManager.java:117)
   at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:916)
   at java.lang.Thread.run(Thread.java:818)

also
i try make unsigned-android, but i cant install apk

Sidebar design

Need a design for how the left-hand sidebar will work.

Continuous deployment

  • Pick a subdomain.
  • Set up a Travis job or something simple to generate the site and push it to an S3 bucket.
  • Put CloudFront in front of that bucket and point our subdomain at it.
  • Delete the docs directory from the repo.

Style Issues (General)

  1. Add "Beta" label to sidebar as well
    image

  2. For the subsection headings, should the title be of the form Web App Plugins: Reference, or is that redundant?

Completely 0/5, just wondering if someone lands on the page, is it obvious what reference they're looking at (until they check the sidebar, which may be more crowded once we add the other sections to the site)

image

Help Wanted: When Selecting a Tab From The LHS, The Parent Tab Collapses

Context

When selecting a child tab of a parent tab that only contains single-leveled children, the tab stays open and highlighted. Example: Web App > Developer Apps

Selecting any tab should update the RHS content window and the newly clicked tab should remain highlighted. Also, the parent should not collapse.

However, when selecting a child tab of a parent tab that contains multi-leveled children, clicking the child tab collapses its parent tab. Example: Mobile Apps > Developer Setup > Mobile Apps Workflow

recording

Docs request

Investigate whether this is something configurable via Hugo (the tooling that generates the HTML developer documentation). If it is configurable, submit a dev docs PR that incorporates this configuration.

How you can help

Determine whether this user experience is something we can achieve using the existing dev docs tool chain in place. We don't have the answer to this question yet ourselves, so we're not able to provide much direction on how to get started.

Re-add categories for blog posts

Need to re-add categories for blog posts and figure out why they were working locally but not on the production or other Travis built versions of the site.

They were removed in #228

Add an "Edit on GitHub" button

Should we add an "Edit on GitHub" button/link like we do on docs.mattermost.com, so it's obvious where to go to propose changes?

Style issues at Extend > Server Plugins > Reference

  1. What is the note at the top?
  2. Should "API" heading size match "Testing"? Feels a little large.

image

  1. Same with heading size of the individual "API" heading sizes. We can probably just match the sizes from Web App Plugins > Reference
    image

Syntax highlighting

The extend/server/hello-world page has some Go / YAML blocks that need highlighting. I thought Hugo had syntax highlighting built in, but it doesn't seem to just work.

Integrate section: high level design

High level design.

  • Getting Started
    • How Should I Integrate?
  • Incoming Webhooks
    • Usage
    • Example
  • Outgoing Webhooks
    • Usage
    • Example
  • Slash Commands
    • Usage
    • Example
  • Message Attachments
  • REST API
    • Usage
    • API Reference - link out to api.mattermost.com
    • Personal Access Tokens
    • Example - probably CH's bot sample
  • OAuth 2.0
    • Example - probably EN's oauth sample

Separate contributor flow by project

Currently (#61), we have contribution guidelines, which combines the contributor flows for each project.

It might be worthwhile moving some of the information to the specific project sections, so that someone working on Redux tickets have a single flow to follow (instead of reading about other repos in that process)

Server Plugin Developer Workflow - Document rebuild and redeploy steps.

It would be helpful to have some steps for making code changes, rebuilding, and redeploying server plugins for testing at the bottom of https://github.com/mattermost/mattermost-developer-documentation/blob/master/site/content/extend/plugins/server/hello-world.md#installing-the-plugin.

What's the most efficient approach? Right now I disable the plugin in the Management Console, then:

<plugin dir> $ make deploy # this directory is parallel to the mattermost-server directory

Then I re-enable the plugin and I see my updates. Is this the most efficient way?

Happy to type up the PR if someone can confirm the steps.

Thanks!

Provide response payload example for submission of Interactive Dialog

Humble apologies if this has previously been covered, or if I've missed it, but the documentation for how to handle responding to an Interactive Dialog submission appears to be a bit unclear.

Page: https://docs.mattermost.com/developer/interactive-dialogs.html

The text states:

Finally, once the request is submitted, we recommend the integration to respond with a system message or an ephemeral message confirming the submission.

However it is not clear on how to structure this response. I have made attempts to respond with a payload akin to a standard Slash Command response, as well as that for an Interactive Message response. While it is likely that I have simply configured my code incorrectly, I believe having a hard example of how to respond to a Dialog submission would help users, especially as all other submissions and responses on the above documentation page come with payload examples.

Contribute section: high level design

High level design.

  • Getting Started
    • Contribution Guidelines
    • Core Committers
    • Project Repositories
  • Server
    • Environment Setup
    • Workflow
    • Systems
      • Application Layer
      • Model and Driver
      • REST API
      • Store Layer
      • CLI
      • WebSocket
      • Job Server
      • Utilities
  • Webapp
    • Environment Setup
    • Workflow
    • Systems
      • Router
      • Components
      • Actions
      • Reducers
      • Selectors
      • SASS
  • Mobile
    • Environment Setup
    • Workflow
    • Systems
      • TBD
  • Redux
    • Environment Setup
    • Workflow
    • Systems
      • Actions
      • Reducers
      • Selectors
  • Desktop
    • Environment Setup
    • Workflow
    • Systems
      • TBD

Need better way to commit build

Right now you need to run hugo in the /site directory which will dump the built site into /docs which is pretty messy and will likely make rebasing a pain.

Help Wanted: Update push proxy setup with docs for systemd distros

the current docuementation here is probably written with ubuntu 16.04 in mind which still used upstart. doing the steps on 18.04 won't work since it's using systemd.

the docs need to be updated to reflect those changes since this will also not work on newer rhel releases and 16.04 will be EOL in 2020.

Elias also pointed out that it might be better to make the docs system agnostic and not show include any particular step by step solution for the system files but rather point in the right direction, which would prevent situations like this in the future.

Internal documentation

Things that people that aren't Mattermost employees are extremely unlikely to care about, such as "how to ssh into a machine", or "how to upgrade go on the build servers".

Should this stuff go into the contribute section? Should it go in another site altogether such as a wiki?

I think there are at least two important factors to consider:

  • Keeping noise and UI clutter to a minimum for our visitors: Most visitors won't care and shouldn't have to visually filter this stuff out of a sidebar or navigation UI. You shouldn't really see this section unless you're looking for it.
  • Keeping low maintenance overhead for internal documentation: The bar for internal documentation doesn't need to be as high as our public documentation. Things don't need to look pretty, get PM approval, go through dev review, or be dumbed down for the general public. A dumping ground for knowledge is all we need.

Background covers footer on an external monitor

The blue background covers part of the footer when viewing developers.mattermost.com on an external monitor. I implemented a quick change to fix this, but was wondering if viewing on mobile should be improved (gap between Extend section and footer) before submitting a PR. Thoughts?
Before
screen shot 2018-05-18 at 4 59 19 pm

After
screen shot 2018-05-18 at 5 00 59 pm

Mobile
image uploaded from ios

Missing config file.

Error: Unable to locate Config file. Perhaps you need to create a new site.
       Run `hugo help new` for details. (Config File "config" Not Found in "[/Users/chris/repos/mattermost/mattermost-developer-documentation]")

Forget to commit something?

Documentation page styling

Need some better styling for the documentation pages.

Main needs:

  • Better text size
  • Mattermost colors
  • Anything improving readability

Proposed improvements for Manifest Reference

Propose tweaking the top portion of the manifest reference

Current:
image

Proposed (up for feedback):

Manifest Reference
===============

The plugin manifest defines the metadata required to load and present your plugin. The manifest file should be named plugin.json or plugin.yaml and placed in the top of your plugin bundle.

Example plugin.yaml:

{code}
id: com.mycompany.myplugin
name: My Plugin
description: This is my plugin. It does stuff.
backend:
    executable: myplugin
settings_schema:
    settings:
        enable_extra_thing:
            type: bool
            display_name: Enable Extra Thing
            help_text: When true, an extra thing will be enabled!
            default: false
{code}

Table of Contents
-------------------

<TOC items here>

Followed by the documentation

It might be worth reviewing the doc formatting as well. It's okay for now, but it's a little hard to follow especially with the indentation towards the end.

image

Edit links

It'd be nice to have an edit link on each page to make it apparent that the pages are open to public contributions and make contributing stupid simple. For example, the "Developer Setup" page would have a link like this: Edit on GitHub or maybe just โœ๏ธ

Plugin back-end API reference

Gonna mull over this for another day or two at least before doing anything. Feedback appreciated.

Step One: Improve Existing Documentation

The existing documentation could be more thorough, and I'd like to add some examples. Examples are a bit weird, because they're expected to be complete, functional, and runnable on the playground. Of course, we can't run plugins on the playground, but I think a decent way to go is to create an exampleplugin package that drives the example. It would provide an exampleplugin.Main function that makes it interchangeable with rpcplugin:

package main

import (
	"fmt"
	"net/http"

        // When building a real plugin, replace "exampleplugin" with "rpcplugin".
	pluginimpl "github.com/mattermost/mattermost-server/plugin/exampleplugin"
)

type MyPlugin struct{}

func (p *MyPlugin) ServeHTTP(w http.ResponseWriter, _ *http.Request) {
	fmt.Fprintf(w, "Hello, world!")
}

func main() {
	pluginimpl.Main(&MyPlugin{})
}

exampleplugin.Main would invoke whatever hooks the plugin has implemented with representative input, then display some feedback in stdout as necessary to make it clear what's happening.

This would hopefully allow users to get a more hands-on idea of what the inputs and outputs of the API look like.

Step Two: Integrate the Documentation into the Site

We can use the godoc package to parse all of the comments in the standard way: https://godoc.org/golang.org/x/tools/godoc

We more or less just need to make a template and wrap that in a nice little command.

The thing I'm not sure about here is the best way to work this into the build process. Should we just generate site/content/extend/server/api-reference.md entirely before invoking the hugo command to generate our HTML? That wouldn't be too bad, but I feel like there's probably a more elegant way to integrate with hugo. (Update: Generating data templates instead of markdown would probably be one step better.)

Extend section: high level design

High level design. Individual issues can be opened for each section.

  • Plugins
    • Overview
    • The Manifest (with reference / documentation parsed from source)
    • Front-end
      • Introduction - How front-end customization is done, broad overview.
      • Quickstart - Hello world!
      • API Reference - Which elements can be plugged into, etc.
      • Playground? - Seems like it would be feasible to create a playground environment for UI elements.
    • Back-end
      • Introduction - How back-end customization is done, broad overview.
      • Quickstart - Hello world!
      • API Reference - More or less the godoc page, reskinned.
    • Examples
  • Forking Mattermost

Add Dev Talks to Developers Site

We have a lot of great information available in the Dev Talks on our YouTube page, but they aren't very discoverable. Add a section to the dev site that includes these videos. Ideally this would be automatically generated by querying the YouTube API, and would include both the embedded video, and any text from the video description.

This issue is also being tracked in JIRA.

Make nodejs 10.11.0 (npm 6.4.1) strongly recommended (required?)

Currently, the Developer Setup page reads:

This includes NPM which is also needed. Currently version 10.11.0 is recommended with npm 6.4.1. 11.x is not working.

After several hours of trying to create a reproducible build environment for our needs, I believe that the version 10.11.0 with npm 6.4.1 is not only recommended, it is required.

None of the official current releases of NodeJS build mattermost-mobile successfully.

I could not get any of these versions to work:
10.16.3 (npm 6.9.0) - memory leak around source-map
12.9.1 (npm 6.10.2) - problems with redux and deps
8.16.1 (npm 6.4.1) - can't remember the error(s)

That means that none of the nodejs docker images worked for us. I am not a technical user anymore so I could have missed something.

There is one easy way to prevent people from spending the time I did on this.

Would you be willing to consider making the assertion about nodejs and npm versions more strongly?

Possibly include that information in the mattermost-mobile project readme, update the Developer Setup page to make it clear that this is what Mattermost is using.

Notification bar improvements

For the notification bar that can be enabled by setting params.notifcation.enable to true in config.toml

  • Make it closable
  • When at top, don't cover menus but float (stay at top of screen) on scroll

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.