Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add DocC API documentation #214

Merged
merged 16 commits into from
Jan 21, 2022
Merged

docs: add DocC API documentation #214

merged 16 commits into from
Jan 21, 2022

Conversation

cbaker6
Copy link
Contributor

@cbaker6 cbaker6 commented Aug 17, 2021

New Pull Request Checklist

Issue Description

Starting from Xcode 13, DocC can be used to build documentation natively. These make the docs look exactly look like the apple docs along with enabling the addition of interactive tutorials. Tutorials can be created easily from the Playground code, though screenshots will need to be added to the tutorial assets to make them look nice.

Related issue: #n/a

Approach

  • Add DocC docs for the SDK
  • Keep Jazzy for now as DocC doesn't work with static Github Pages. Static pages will be supported when Swift 5.6 is released

TODOs before merging

  • add DocC build to CI
  • add change log

@cbaker6 cbaker6 requested a review from TomWFox August 17, 2021 18:15
@cbaker6
Copy link
Contributor Author

cbaker6 commented Aug 17, 2021

@TomWFox this should make the docs look even nicer and once some of the interactive tutorials are added from the Playgrounds allow linking to blogs, etc. The tutorials are pretty easy to make and will look like: https://developer.apple.com/tutorials/SwiftUI

I've attempted to make this release to the current documentation link (I think this has to be http://parseplatform.org/Parse-Swift/documentation to work), though we will need to test this some to see if it works.

The docs will look like (can be switched to dark/light mode by the user): https://syndikit.dev/documentation/

In Xcode, developers will see:
image
Let me know what you think.

@TomWFox
Copy link
Contributor

TomWFox commented Aug 18, 2021

This looks great, thanks for all the insightful info. I'm looking forward to interactive tutorials!

I don't think changing http://parseplatform.org/Parse-Swift/api to http://parseplatform.org/Parse-Swift/documentation should be a major issue if needs be.

@cbaker6
Copy link
Contributor Author

cbaker6 commented Aug 19, 2021

@TomWFox I tried this out on one of my personal repo's and it seems there's some additional work we need to figure out with GitHub Pages to get this to show the documentation. I think it has something to do with finding the equivalent to:

# Enable custom routing.
RewriteEngine On

# Route documentation and tutorial pages.
RewriteRule ^(documentation|tutorials)\/.*$ ParseSwift.doccarchive/index.html [L]

# Route files and data for the documentation archive.
#
# If the file path doesn't exist in the website's root ...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# ... route the request to that file path with the documentation archive.
RewriteRule .* ParseSwift.doccarchive/$0 [L]

In Jekyll, https://developer.apple.com/documentation/Xcode/distributing-documentation-to-external-developers

Conflicts:
	ParseSwift.xcodeproj/project.pbxproj
@TomWFox
Copy link
Contributor

TomWFox commented Aug 24, 2021

Hmm, I did some reading and it seems it’s not currently possible to host DocC as a static site for GitHub pages. This post was insightful https://www.jessesquires.com/blog/2021/06/29/apple-docc-great-but-useless-for-oss/ - there was a reference to a post about converting the archive to a static site but I would imagine that could be a janky solution.

It seems straight forward to host DocC on Netlify or similar but it wouldn’t be ideal to loose the simplicity of gh pages.

We may have to wait to see how things develop here.

@cbaker6
Copy link
Contributor Author

cbaker6 commented Aug 24, 2021

Great find! From the article, they linked to a tweet which mentions DocC may eventually be hosted by Swift Package Index which would make for an easy process https://twitter.com/_sa_s/status/1410155365270966274?s=21

Conflicts:
	CHANGELOG.md
	Sources/ParseSwift/ParseConstants.swift
@cbaker6 cbaker6 changed the title Use DocC for documentation docs: Use DocC for API documentation Sep 23, 2021
@parse-github-assistant
Copy link

parse-github-assistant bot commented Sep 23, 2021

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@cbaker6 cbaker6 marked this pull request as draft September 23, 2021 19:06
@parse-github-assistant
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title docs: Use DocC for API documentation docs: use DocC for API documentation Jan 21, 2022
@codecov
Copy link

codecov bot commented Jan 21, 2022

Codecov Report

Merging #214 (3627dcd) into main (054a226) will increase coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #214      +/-   ##
==========================================
+ Coverage   84.98%   85.01%   +0.03%     
==========================================
  Files         114      114              
  Lines       12048    12048              
==========================================
+ Hits        10239    10243       +4     
+ Misses       1809     1805       -4     
Impacted Files Coverage Δ
Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift 73.52% <ø> (+0.59%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 054a226...3627dcd. Read the comment docs.

@cbaker6 cbaker6 marked this pull request as ready for review January 21, 2022 17:05
@cbaker6 cbaker6 changed the title docs: use DocC for API documentation docs: add DocC API documentation Jan 21, 2022
@cbaker6 cbaker6 merged commit 7cbf97b into main Jan 21, 2022
@cbaker6 cbaker6 deleted the docc branch January 21, 2022 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants