From a6584714c337622c208f0422e2265d640423fb03 Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Sun, 26 Nov 2017 21:51:06 -0800 Subject: [PATCH 1/2] New onboarding document --- server/models/Collection.js | 5 ++-- server/models/Team.js | 5 ++-- server/utils/onboarding.js | 48 +++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 server/utils/onboarding.js diff --git a/server/models/Collection.js b/server/models/Collection.js index fd22a77cc..fa3d18d96 100644 --- a/server/models/Collection.js +++ b/server/models/Collection.js @@ -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 { diff --git a/server/models/Team.js b/server/models/Team.js index 80cf88521..d1f61c47a 100644 --- a/server/models/Team.js +++ b/server/models/Team.js @@ -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) { diff --git a/server/utils/onboarding.js b/server/utils/onboarding.js new file mode 100644 index 000000000..914ea8280 --- /dev/null +++ b/server/utils/onboarding.js @@ -0,0 +1,48 @@ +// @flow +const template = `# Welcome to Outline + +Outline a place for your team to build your knowledge base. This can include: + +* Team wiki +* Documentation +* Playbooks +* Employee onboarding + +...and anything you can think of. + +## 🖋 Editor to fit your needs + +![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 is build to be fast and extensible. You can easily format your documents with keyboard shortcuts or simply highlighting the text and making your selections. To add images, just drag and drop them to your canvas. + +Like many developers, we love [Markdown](http://commonmark.org/help/) and you can format your Outline documents by writing Markdown it will get formatted without the need for previews. + +## 👩‍💻 Developer friendly + +Outline features an [open API](https://www.getoutline.com/developers) and syntax highlighting which makes it ideal for software teams. To create your first document using the API, create an API key in [settings](https://www.getoutline.com/settings/tokens) and run the following Javascript code. Just remember to update your API key and keep it secure! + +\`\`\` +const newDocument = { + title: 'Getting started with codebase', + text: 'All the information needed in Markdown', + collection: 'COLLECTION_ID', + token: 'API_KEY', // Replace with a key 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). +`; + +export const welcomeMessage = collectionId => + template.replace('COLLECTION_ID', collectionId); From eb1ba1a6be252bf4d7171e2b46b2b64482eb56e6 Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Wed, 17 Jan 2018 22:16:13 -0800 Subject: [PATCH 2/2] changed copy --- server/utils/onboarding.js | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/server/utils/onboarding.js b/server/utils/onboarding.js index 914ea8280..c729a0cfc 100644 --- a/server/utils/onboarding.js +++ b/server/utils/onboarding.js @@ -1,33 +1,31 @@ // @flow -const template = `# Welcome to Outline +export const welcomeMessage = (collectionId: string) => + `# Welcome to Outline -Outline a place for your team to build your knowledge base. This can include: +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 -...and anything you can think of. - -## 🖋 Editor to fit your needs +## 🖋 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 is build to be fast and extensible. You can easily format your documents with keyboard shortcuts or simply highlighting the text and making your selections. To add images, just drag and drop them to your canvas. - -Like many developers, we love [Markdown](http://commonmark.org/help/) and you can format your Outline documents by writing Markdown it will get formatted without the need for previews. +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 [open API](https://www.getoutline.com/developers) and syntax highlighting which makes it ideal for software teams. To create your first document using the API, create an API key in [settings](https://www.getoutline.com/settings/tokens) and run the following Javascript code. Just remember to update your API key and keep it secure! +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: 'COLLECTION_ID', - token: 'API_KEY', // Replace with a key from https://www.getoutline.com/settings/tokens + collection: '${collectionId}', + token: 'API_KEY', // Replace with a value from https://www.getoutline.com/settings/tokens }; fetch('https://www.getoutline.com/api/documents.create', { @@ -39,10 +37,7 @@ fetch('https://www.getoutline.com/api/documents.create', { }); \`\`\` -## 💬 Say hi to the team +## 👋 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). `; - -export const welcomeMessage = collectionId => - template.replace('COLLECTION_ID', collectionId);