Merge pull request #452 from outline/jori/basic-onboarding

Improved onboarding
This commit is contained in:
Jori Lallo
2018-01-17 22:52:46 -08:00
committed by GitHub
3 changed files with 48 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ import { asyncLock } from '../redis';
import events from '../events';
import Document from './Document';
import Event from './Event';
import { welcomeMessage } from '../utils/onboarding';
// $FlowIssue invalid flow-typed
slug.defaults.mode = 'rfc3986';
@@ -57,8 +58,8 @@ const Collection = sequelize.define(
userId: collection.creatorId,
lastModifiedById: collection.creatorId,
createdById: collection.creatorId,
title: 'Introduction',
text: '# Introduction\n\nLets get started...',
title: 'Welcome to Outline',
text: welcomeMessage(collection.id),
});
collection.documentStructure = [document.toJSON()];
} else {

View File

@@ -32,14 +32,13 @@ Team.associate = models => {
};
Team.prototype.createFirstCollection = async function(userId) {
const atlas = await Collection.create({
name: this.name,
return await Collection.create({
name: 'General',
description: 'Your first Collection',
type: 'atlas',
teamId: this.id,
creatorId: userId,
});
return atlas;
};
Team.prototype.addAdmin = async function(user: User) {

View File

@@ -0,0 +1,43 @@
// @flow
export const welcomeMessage = (collectionId: string) =>
`# Welcome to Outline
Outline is a place for your team to build your knowledge base. This can include:
* Team wiki
* Documentation
* Playbooks
* Employee onboarding
* ...or anything you can think of
## 🖋 A powerful editor
![Text formatting in Outline](https://s3.amazonaws.com/dev.beautifulatlas.com/uploads/e2b85962-ca66-4e4c-90d3-b32d30f0610c/754830c0-2aca-467c-82de-2fd6e990b696/Group.png)
Outline's editor lets you easily format your documents with keyboard shortcuts, Markdown syntax or by simply highlighting the text and making your selections. To add images, just drag and drop them to your canvas.
## 👩‍💻 Developer friendly
Outline features an [API](https://www.getoutline.com/developers) for programatic document creation. To create your first document using the API, simply write it in Markdown and make a call to add it into your collection:
\`\`\`
const newDocument = {
title: 'Getting started with codebase',
text: 'All the information needed in Markdown',
collection: '${collectionId}',
token: 'API_KEY', // Replace with a value from https://www.getoutline.com/settings/tokens
};
fetch('https://www.getoutline.com/api/documents.create', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(newDocument),
});
\`\`\`
## 👋 Say hi to the team
Outline is build by a small team and we would love to get to get to know our users. Drop by at [our Spectrum community](https://spectrum.chat/outline) or [drop us an email](mailto:hello@getoutline.com).
`;