-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Include Phoenix guides with framework API docs #1960
Conversation
This is as much as I can do without touching the phoenix_guides repo. If the guides still need to be publishable at Readme.io, then I would suggest creating an 'exdoc' branch of phoenix_guides so that people can open PRs against it. (Github lets you choose the "merge ... into" branch when opening a PR.) Suggested next steps:
Notes:
|
This is awesome! Thanks for picking this up again. Hosting a preview is very helpful too. I've created a branch from master on the guides https://github.com/phoenixframework/phoenix_guides/tree/ex_doc @josevalim may have some ideas for what is required (if anything) on the ex_doc side of things to support sub sections. |
Thank you @wsmoak! ❤️ 👍 for using I will look into supporting subsections and directories. |
Update 1: We cannot support directories because it breaks assets such as javascript and css (we assume they are in the same directory which is necessary if we want to work on hexdocs and things of sorts). Update 2: Note that the option Update 3: PR for groups sent here: elixir-lang/ex_doc#613 |
I added the groups in this commit Gazler@ebaf135 - feel free to pull it into this PR, we should probably wait for ex_doc to be released before finalizing though. Preview: https://s3.amazonaws.com/gazler.phoenix.guides/a_introduction.html |
re: |
@wsmoak great catch, all fixed! :D |
6cb4797
to
85c8702
Compare
FWIW, readme.io also flattens the directory structure when it generates the html. Now that we have 'group' to do the submenus it's about the same.
|
I haven't looked into why this happens yet, but I have found a couple issues by glossing over the guides and just wanted to make a note of them: The list items about half way down http://wsmoak.net/phoenix/overview.html are collapsed into a single longer list. The image at the bottom of http://wsmoak.net/phoenix/adding-pages.html#another-new-page is 404ing |
Oh, you will almost certainly need to change the structure when it comes to assets. ExDoc allows you to put anything you want inside the doc/ directory, so you can put assets in @milmazz, what do you think would be the best way to support assets in the epub formatter? Should we have a directory where supposedly all assets go? Should we just assume it is doc/assets? |
a53fbbf
to
fbff3e3
Compare
It's looking good! I'll open a PR for the h1's against the ex_doc branch of phoenix_guides (unless someone beats me to it). Once those start appearing I'll drop as many of the Currently the .md files in phoenix_guides are not under the 'docs' directory. I could go either way -- that repo doesn't really need to follow the project directory structure, but doing so and adding a minimal mix.exs there might make it easier for contributors to preview changes locally. I assume we aren't going to officially release phoenix_guides on hex, but to just point from here to a branch of the docs for each release, so that docs changes can be made after a Phoenix release, and anyone cloning the source will get the updated docs. It will be far easier for someone with direct access to the repo to do any file renaming and/or moving of assets. I'll keep an eye on the ex_doc branch of phoenix_guides, and adjust the paths in this PR to match. BTW If you're going to rename things... the .md files don't really need the capital letter prefix that controlled the ordering for readme.io. (And then we could drop the |
@josevalim I think that the easiest way to go is having a directory where we put all the assets, right now the EPUB formatter puts the logo under the
|
It would be nice to be able to build the guides in isolation.
I'll take this on - I'll drop the letter prefixes whilst I am at it (phoenixframework/phoenix_guides#586) One additional thing I think we should do as well is move this directory out into its own repo. https://github.com/phoenixframework/phoenix_guides/tree/master/styling (If we use git filter-branch then we should be able to preserve the history too.) |
@milmazz we can either ask for an assets directory, outside of |
@josevalim Sounds good to me 👍 |
@milmazz beautiful. I will ensure it works on master. We just need to guarantee we put the logo there and that we won't warn/raise/fail if the logo is already there. :) |
@milmazz so I started implementing this and I realized it is a bad. If we mix generated content (like logo.png) with user content, we will be mixing those artifacts in a way that makes it hard to gitignore them. Also, given that epub will have to copy the assets anyway to a separate directory, I am starting to think it is best to ask the user for an assets directory and we will automatically copy everything over. |
@josevalim Please, let me know if I got this right, as an example, let's assume the current Phoenix Guides: $ ls deps/phoenix_guides/images/
hello-from-phoenix.png hello-world-from-frank.png welcome-to-phoenix.png The user just need to include the directory If the user also specifies a logo, the |
@milmazz we could make it work like that but I have pushed another implementation to master. In master, if the user specifies This feature is already on ExDoc master for both html and epub. :) The idea of copying everything into a single directory is to keep everything contained. I am not sure if all formats would allow us to add entries at the root. |
@wsmoak @Gazler please give a try, whenever you have some time, to the assets feature in ExDoc master. The idea is the following, if you specify:
Everything inside "deps/phoenix_guides/assets" will be copied to "doc/assets", which means you will be able to access those images using "assets/name.extension" in your markdown files. For example, if you have "deps/phoenix_guides/assets/images/hello.png" and you specify |
a9ef0b8
to
15c2f7a
Compare
I added the I'll wait to see things get re-arranged in the ex_doc branch of phoenix_guides, it sounds like that will adopt the standard directory structure and get some re-naming done. |
Thank you @wsmoak. ExDoc v0.14.3 has been released with support for assets and for grouping guides together. |
@josevalim @Gazler @wsmoak I'd be happy to help with this if theres anything that I could throw in that would be useful. I love working on the guides and would be very happy to help contribute to this further and make the transition easy :) Let me know. I also was curious about the roadmap for the 1.3 updates for the guides since the new project structure etc will require a lot of updating of smaller things. |
15c2f7a
to
2d79a53
Compare
Thanks, I've updated to the ex_doc release. If someone has time to review and merge phoenixframework/phoenix_guides#594 that adds the h1 headings, then I can remove the |
2d79a53
to
4d60947
Compare
a5220ef
to
198a0b6
Compare
198a0b6
to
56d9609
Compare
This is waiting on the ex_doc branch of phoenix_guides [1] moving to master. See discussion: phoenixframework/phoenix_guides#391 (comment) (I don't know what's up with the test failure on this though... I've only touched the mix files.) [1] which moves the files down into 'docs' and adds h1 headers to each page |
56d9609
to
98a55cf
Compare
- Declare dependency on phoenix_guides (in docs environment only) - Add extras page for each guide with custom group - Titles are taken from new h1 elements on guide pages - Make Overview the main page of the framework docs - Set preferred environment for `docs` task so you don't have to type `MIX_ENV=docs`, just `mix docs` will work See discussion on phoenixframework/phoenix_guides#391
98a55cf
to
1a615aa
Compare
The ex_doc-related changes to phoenix_guides have been merged to master (thanks @Gazler !). I updated this to pull in the default branch of phoenix_guides as a git dependency, so it's grabbing master, currently at 4ec8022 . Here are the latest generated docs as a preview: http://wsmoak.net/phoenix/overview.html This PR is ready to merge to master any time. As discussed in phoenixframework/phoenix_guides#391 (comment) the docs are not yet perfect, some h3's need to be h2's and some links are probably broken, but it will be much easier for people to help if it's all on master of both repos. Let me know what you think and/or if you want any changes to this! |
Thanks so much @wsmoak! Sorry for my delay on this discussion, but I'm just about caught up on my backlog and ready to help iron out any docs issues we come across. <3 <3 <3 |
See discussion on phoenixframework/phoenix_guides#391
To preview, check out the branch, run
MIX_ENV=docs mix docs
, and viewdoc/index.html
.Or view: http://wsmoak.net/phoenix (published at ref 6cb4797)