• Stars
    star
    161
  • Rank 233,470 (Top 5 %)
  • Language
    Swift
  • License
    MIT License
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Generate help centers for your iOS apps. Hosted by GitHub and always up-to-date.

SupportDocs Logo

SupportDocs Header

Generate help centers for your iOS apps, with Markdown!

All you need to do is write your documents on GitHub, and install the library in your app. SupportDocs' custom GitHub Action and GitHub Pages will take care of the rest.

Table of Contents

How It Works

  1. Write documents in Markdown, on GitHub
  2. GitHub Pages will convert them into HTML and host it for free
  3. A custom GitHub Action will generate a JSON data source for you
  4. The SupportDocs library will download the JSON and display it to your users!

How It Works - Graphic

The SupportDocs library is written in SwiftUI, so it's only for iOS 13 and above.

Installation

Installing SupportDocs takes two steps:

  1. Set up the GitHub repository where you write and host your documents
  2. Install the library inside your app

Set Up the GitHub Repository

This will be where you write your documents. GitHub Pages will translate your Markdown into HTML, and a custom GitHub Action will automatically compile the web pages into a JSON file.

  1. Scroll up to the top of this page and click Use this template
  2. Enter a repository name -- this can be whatever you want
  3. Make sure it's set to Public (If you are using the free version of GitHub, GitHub Pages only works for public repos)
  4. Make sure to check Include all branches. This is really important.
  5. Click Create repository from template
  6. In your brand new repository, click the Settings tab
  7. Scroll down to the GitHub Pages section, and select DataSource branch and / (root) folder. Then click Save.
  8. That's it for the GitHub repository! Now time to install the library in your app.

Install the Library

This is the actual interface that your users will see. You can install using CocoaPods or Swift Package Manager, whichever one you prefer.

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To install SupportDocs into your Xcode project using CocoaPods, add it in your Podfile:

pod 'SupportDocs'

Swift Package Manager

The Swift Package Manager is built into Xcode, which makes it really easy to use.

  1. Go to your project settings
  2. Click your project
  3. Switch to the Swift Packages tab
  4. Click the + button
  5. Enter https://github.com/aheze/SupportDocs in the text field
  6. Click Next
  7. Enter the latest version, 1.1.0, in the text field. Leave Up to Next Major selected.
  8. Click Next
  9. Click Finish, and you're done!

Example Project

Check out the example project in the Example folder! It contains a playground where you can play around with how SupportDocs is displayed.

Example project home page Example project options page Press the "Present" button to display the library

Usage

SupportDocs is pretty simple to use, with two parts: the GitHub repository and the library in your app.

The GitHub repository is where you add and edit your documents using Markdown. This is online, so you can edit at any time and always show the latest information to your users. All your documents are compiled into a single JSON file, the URL of which you'll pass into the library. The library is what's displayed to your users, in your app. All it needs is the URL of the JSON file, and you can either use SwiftUI or UIKit to embed it.

Show Extended Documentation

Using the GitHub Repository

In you brand new repository that you set up earlier, switch to the DataSource branch. The example documents are inside the Sample-Boba, Sample-FastFood, and Sample-Smoothies folders -- take a look around. Here's a guide:

Show guide

  • .github/workflows is for the GitHub Action, for compiling your documents into JSON
  • Images contains the images used in the example documents
  • Sample-Boba contains all documents tagged with boba
  • Sample-FastFood contains all documents tagged with fastFood
  • Sample-Smoothies contains all documents tagged with smoothies
  • _data contains the generated data source URL
  • _layouts is for GitHub Pages to convert your Markdown into HTML
  • _sass is where you can customize the look of the HTML, including light and dark mode colors
  • _scripts contains the script used by the GitHub Action, as well as the README template. This template is what you should edit if you want to change the README at all -- if you change it directly, your changes will be overriden.
  • assets/css applies the _sass
  • .gitignore is for git to ignore unnecessary files
  • 404.md is the 404 document that will be displayed if your URLs are wrong. You can also pass this into options.other.error404 in case your data source URL fails.
  • README.md is for your reference. It contains a link to the data source URL, and a table of contents that shows all your documents. Do not edit this file directly -- instead, edit the file in _scripts/README.md.
  • _config.yml sets the default theme, "Primer," for GitHub Pages. We recommend that you don't change this, as we customized dark mode specifically for the "Primer" theme -- you'll need to configure assets/css/main.scss if you use your own theme.

Documents can be placed in the root directory or a subfolder. However, we recommmend that you use folders to organize your documents. In the example,

  • Documents tagged with boba are in the Sample-Boba folder
  • Documents tagged with fastFood are in the Sample-FastFood folder
  • Documents tagged with smoothies are in the Sample-Smoothies folder

Adding and Editing Documents

  • To add a document, click the Create new file button.
  • If you want to add it to a folder, navigate to the folder first and then click the Create new file button.
    • If you want to create a new folder, click Create new file -- then, in the filename, first put the folder name, then a slash (/), followed by the filename (Example: fastFood/Burgers.md). Read more here.
Add a Document Add a Document in the Sample-Boba Subfolder
Root Directory "Create new file" Subfolder "Create new file"

Then, to make the document eligible for SupportDocs, you must fulfill these criteria:

  • The document extension must end in .md
  • At the top of the document (this is called the front matter), you need to fill in the title. We strongly suggest you add tags too.
---
title: Buy blue boba
tags: boba
---

Example File With Front Matter Highlighted

The title is what will be displayed in each row of the list, in the SupportDocs library. Once you select a row, it's also what's shown as the title of the navigation bar.

Title in Library List Title in Navigation Bar

Everything after the --- of the front matter is your document's content. You use Markdown to write your documents.

Markdown Result          
---
title: Buy blue boba
tags: boba
---

# Buy blue boba

Blue and yummy. Buy this at [google.com](https://google.com)

1. Eat
2. Eat
3. Eat
4. Eat
5. Eat

![Blue Boba Image](https://raw.githubusercontent.com/aheze/SupportDocs/DataSource/Images/blueBoba.jpg)

Tagging Documents

With tags, you get a lot of control over what to display in the library. To add tags, just fill in the tags, underneath the title. For example, check out this example document in the DataSource branch.

---
title: Buy blue boba
tags: boba
---

This document has the tag boba. As you might assume, there are other documents in the DataSource branch also tagged with boba.

Here is a graphic which shows the documents, titles, and tags in the DataSource branch.

Documents with Front Matter

Once your documents have tags, you can choose to show which documents to show and which ones to hide, in the library. This is covered in the Categories section of the library customization documentation.


Using the Library

The library is the view that you embed in your app, and what the user sees. But before you present it, you need to get the data source URL first! Go to your brand-new repo's DataSource branch, scroll down to the README, and copy the URL.

Data Source URL Location

The custom GitHub Action generated this URL for you, so keep it safe!

Now you can present the view in your app. You can use SwiftUI or UIKit, and here's the least code that you need to write for it to work.

SwiftUI

import SwiftUI
import SupportDocs

struct SwiftUIExampleViewMinimalCode: View {
    let dataSource = URL(string: "https://raw.githubusercontent.com/aheze/MyHelpCenter/DataSource/_data/supportdocs_datasource.json")!
    @State var supportDocsPresented = false
    
    var body: some View {
        Button("Present SupportDocs from SwiftUI!") { supportDocsPresented = true }
        .sheet(isPresented: $supportDocsPresented, content: {
            SupportDocsView(dataSourceURL: dataSource, isPresented: $supportDocsPresented)
        })
    }
}

UIKit

import UIKit
import SupportDocs

class UIKitExampleControllerMinimalCode: UIViewController {
    
    /**
     Connect this inside the storyboard.
     
     This is just for demo purposes, so it's not connected yet.
     */
    @IBAction func presentButtonPressed(_ sender: Any) {
        
        let dataSource = URL(string: "https://raw.githubusercontent.com/aheze/MyHelpCenter/DataSource/_data/supportdocs_datasource.json")!
        
        let supportDocsViewController = SupportDocsViewController(dataSourceURL: dataSource)
        self.present(supportDocsViewController, animated: true, completion: nil)
    }
}

Result

Result Graphic

Now that you have the library set up and working, you can hop on over to the library customization section and customize SupportDocs to your liking. Perhaps add a "Dismiss" button or only show documents with specific tags.


Customization

You get a lot of control over what to display.

  • Document Rendering: How your Markdown should be rendered. Customize colors and add your own HTML if you want!
  • Library: The basic navigation that's displayed to the user. Customize pretty much anything, from categories to the navigation bar color.
Document Rendering Library
Document rendering graphic Library options graphic

Authors

SupportDocs is a project maintained by A. Zheng and H. Kamran.

License

MIT License

Copyright (c) 2022 A. Zheng and H. Kamran

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Notes

Example repo

You can find an example repository generated from SupportDocs here.

Data collection

SupportDocs does not collect any data. We provide this note to help you fill out your App Privacy Details.

Testing on Apple Silicon / Big Sur

On my MacBook Pro M1 running Big Sur 11.0.1, I get a crash when loading the web page on iOS 13 simulators. It works fine for iOS 14, and the crash doesn't happen at all when I run on my Intel Mac. I'm pretty sure that this won't be a problem for actual devices, but keep in mind that you might run into some issues during testing. Apple is still polishing up Big Sur.

Dark Mode

SupportDocs supports Dark Mode right out of the box! You don't need to do anything.

Dark Mode Graphic

More Repositories

1

Popovers

A library to present popovers. Simple, modern, and highly customizable. Not boring!
Swift
1,944
star
2

Setting

Compose beautiful preference panels.
Swift
1,429
star
3

SwipeActions

Add customizable swipe actions to any view.
Swift
1,016
star
4

OpenFind

An app to find text in real life.
Swift
983
star
5

Prism

A lightweight 3D renderer for SwiftUI.
Swift
923
star
6

Multiliner

An Xcode source extension to expand lengthy lines.
Swift
829
star
7

Squirrel

Enable scrolling in the Xcode Simulator!
Swift
620
star
8

VariableBlurView

A one-file, App Store upload-safe version of Janum Trivedi's variable blur effect.
Swift
372
star
9

SwiftUICraft

Minecraft but made with SwiftUI.
Swift
303
star
10

RealityKitLaunchScreen

A launch screen made with SwiftUI and RealityKit. Used in the Find app.
Swift
239
star
11

SplitSheet

A lightweight, fully interactive split-screen sheet.
Swift
188
star
12

ProgressGif

Add progress bars to gifs!
Swift
105
star
13

AppClipQuickStart

Make an app clip.
Swift
50
star
14

implicit-curves

Graph implicit curves in Swift
Swift
30
star
15

AccessibleReality

[Accepted] My WWDC21 Swift Student Challenge submission.
Swift
26
star
16

AlternativeARKit

A custom alternative to ARKit
Swift
22
star
17

PathMapper

Find the shortest distance between 2 points on a map!
Swift
19
star
18

StitchCounter

An app to count stitches in crochet patterns. Multiplatform.
Swift
19
star
19

MarkdownTextEditor

Markdown editor in SwiftUI 3
Swift
18
star
20

CustomSCNGeometry

How to make a custom SCNGeometry
Swift
17
star
21

ClassX

Swift
15
star
22

Missions

Missions for Midnight
Swift
13
star
23

QuickOCR

Drag-and-drop to find text. A work in progress.
Swift
12
star
24

ConnectFour

Literally just Connect 4 in SwiftUI
Swift
10
star
25

AnimateBetweenCollectionLayouts

Animate from "horizontal film strip" to "Vertical/expanded stack"
Swift
10
star
26

aheze

8
star
27

SixDegrees

Swift
8
star
28

MetalGradient

Swift
8
star
29

Projector

Forget the Simulator — swap your aspect ratio instead!
Swift
7
star
30

Buildings

Building block app made with SwiftUI
Swift
6
star
31

CalHacks

Swift
5
star
32

AcuteCalculator

Support files for Acute Calculator
5
star
33

ARKitCube

Demo app to render a cube with ARKit and SceneKit.
Swift
5
star
34

BarcodeScanner

Swift
3
star
35

ProjectorExample

Test out your app on different device sizes
Swift
3
star
36

VidQuery

CodeDay - Most Likely to Use winner
Swift
3
star
37

OpenFind-SupportDocs

Help center and other resources for Find app
Swift
3
star
38

TableViewReverseAnimation

Swift
3
star
39

PhotoLoadingTest

Swift
3
star
40

FastAssets

Testing to get photo assets quickly
Swift
2
star
41

SampleApp

A sample app for all purposes. Tap the squircle to spin it.
Swift
2
star
42

Find-Lists

Website for lists sharing in Find (getfind.app)
JavaScript
2
star
43

MyAppClipWebsite

Swift
2
star
44

StatusBarHide

Swift
2
star
45

Findbot

A Python bot. Check it out at https://getfind.app/discord
Python
2
star
46

DeveloperAssets

Just some images. Feel free to store yours here if you want.
Rich Text Format
2
star
47

FindHelp

Short tutorials/help docs for Find app. This is outdated, but I haven't gotten around to updating it
HTML
2
star
48

MyHelpCenter

Swift
2
star
49

FindAppSupport

Useful files that may be used in Find app
HTML
2
star
50

CardScanner

Swift
2
star
51

tdee-calculator

TypeScript
2
star
52

PlaygroundSync

Git for swift playgrounds, under development
Swift
1
star
53

Licenses

For hosting the licenses I use
1
star
54

schedules-ios

The iOS companion for Schedules
Swift
1
star
55

Assets

Just some file storage.
1
star
56

ReadmeTables

Tables don't need to be boring
1
star
57

LearningWebDev

Just learning web development, and following some tutorials! Testing on GitHub Pages.
HTML
1
star
58

SwiftUIImageTransitionTest

Swift
1
star
59

PhotoLoading

Memory issue
Swift
1
star
60

SwiftUISearchBar

Swift
1
star
61

SwiftUICamera

Swift
1
star
62

Find-Assets

Screenshots and other stuff for Find (getfind.app)
1
star
63

Medium

Support files for my Medium articles, but larger projects may have their own repository.
HTML
1
star
64

Find-Issues

Bug tracker for Find
1
star
65

TwoSetTableView

Swift
1
star
66

TargetContentOffsetTest

Demo repo for my question "UICollectionViewFlowLayout `targetContentOffset` - how to keep cells centered after orientation change?"
Swift
1
star
67

Find-Website-Old

Official website of Find app
CSS
1
star
68

TextFieldConstraintDemo

Demo repo for https://stackoverflow.com/questions/65928019/how-to-reduce-width-between-ui-components-in-my-case-uilabel-and-uitextfield
Swift
1
star