Skip to content

Update readme #363

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

Merged
merged 1 commit into from
Mar 4, 2022
Merged

Update readme #363

merged 1 commit into from
Mar 4, 2022

Conversation

kimdv
Copy link
Contributor

@kimdv kimdv commented Feb 18, 2022

I was think if we should SwiftSyntax specific info from root readme into a new readme inside SwiftSyntax source, just like SwiftSyntaxBuilder.
The same for SwiftSyntaxParser.

Then keep the root readme to things that is common for all sources?
Like how to get started developing, report bugs, license etc?

@kimdv kimdv force-pushed the kimdv/update-readme branch 3 times, most recently from 43fdeec to 82d6ec9 Compare February 18, 2022 14:01
@kimdv kimdv force-pushed the kimdv/update-readme branch 3 times, most recently from a3afe4e to 97812db Compare February 19, 2022 14:23
@ahoppen
Copy link
Member

ahoppen commented Feb 21, 2022

I was think if we should SwiftSyntax specific info from root readme into a new readme inside SwiftSyntax source, just like SwiftSyntaxBuilder. The same for SwiftSyntaxParser.

Then keep the root readme to things that is common for all sources? Like how to get started developing, report bugs, license etc?

I would actually prefer to go the other way because I think the readme in Sources/SwiftSyntaxBuilder is not very discoverable and I think the three modules should always be considered together since you don’t have to make a choice and use either one or the other. But then the top-level readme is already getting quite large. What I’m thinking might be beneficial would be to create top-level “Documentation” and “Examples” folder that contains all the documentation that’s not necessary to get started.

The Documentation folder would include documents to

  • Declare SwiftPM dependency with nightly build
  • Embedding SwiftSyntax in an Application (includes Embedding in an iOS Application)
  • Contributing

The examples folder would contain

  • A markdown document with example users
  • .swift files with for the examples we currently show (AddOneToIntegerLiterals and your example to use SwiftSyntaxBuilder)
    • In CI we could also make sure that these examples actually compile. I just noticed that the example in the main README doesn’t even compile because it doesn’t import SwiftSyntaxParser (as a follow-up change)

The main README.md would then include links to the documents in the Documentation and Examples folder. What do you think?

@kimdv
Copy link
Contributor Author

kimdv commented Feb 21, 2022

I would actually prefer to go the other way because I think the readme in Sources/SwiftSyntaxBuilder is not very discoverable and I think the three modules should always be considered together since you don’t have to make a choice and use either one or the other. But then the top-level readme is already getting quite large. What I’m thinking might be beneficial would be to create top-level “Documentation” and “Examples” folder that contains all the documentation that’s not necessary to get started.

Agree on that it can be hard to find and a single readme will become to large and messy.

What about using DocC?
I have seen the documentation from DocC itself. It looks really good. We have the possibility to make guides, how to get started, examples etc.
They have recently added support for static hosted sites: swiftlang/swift-docc#56

The Documentation folder would include documents to

  • Declare SwiftPM dependency with nightly build
  • Embedding SwiftSyntax in an Application (includes Embedding in an iOS Application)
  • Contributing

I think that contributing should be in the main readme as for me it is more "repository" related documentation on how to contribute, where SwiftPM and SwiftSyntax embedding is more documentation for how to use it.
Can you follow me?

The examples folder would contain

  • A markdown document with example users

  • .swift files with for the examples we currently show (AddOneToIntegerLiterals and your example to use SwiftSyntaxBuilder)

    • In CI we could also make sure that these examples actually compile. I just noticed that the example in the main README doesn’t even compile because it doesn’t import SwiftSyntaxParser (as a follow-up change)

It would be pretty cool if we could make the CI actually test/compile the examples. 💪

The main README.md would then include links to the documents in the Documentation and Examples folder. What do you think?

And then I think the contribution, license, issues and so on is added in the main readme.

@kimdv kimdv force-pushed the kimdv/update-readme branch 2 times, most recently from 9b1c4d8 to 578ef92 Compare February 21, 2022 19:47
@ahoppen
Copy link
Member

ahoppen commented Feb 22, 2022

What about using DocC? I have seen the documentation from DocC itself. It looks really good. We have the possibility to make guides, how to get started, examples etc. They have recently added support for static hosted sites: apple/swift-docc#56

Exploring to use DocC would definitely be interesting but there’s a non-trivial deployment story we need to solve. We always want the latest documentation for the current main branch. But that means that we need to do one of the following

  • You need to manually rebuild the documentation when you make any changes
    • I think this is not practical
  • We need to have a CI job that generates and pushes the documentation to a different repository
    • In that case we wouldn’t have any documentation inside this repository itself, which I don’t really like but maybe having a basic README + reference to the DocC-generated documentation would be alright
    • Creating a new repository + the necessary CI job is not something we can set up in the short-term
  • We require users who wish to view the documentation to download the repository and open the documentation themselves
    • I think this raises the entry barrier of figuring out what SwiftSyntax too much because cloning/downloading the repo just to view the basic documentation seems like a fairly big commitment to me

I might have missed an option here because I’m not familiar with DocC but I would suggest that for now we stick with markdown files.

As a separate task, we could consider improving the doc comments of SwiftSyntax to generate better documentation which adopters can build themselves by invoking docc locally.

I think that contributing should be in the main readme as for me it is more "repository" related documentation on how to contribute, where SwiftPM and SwiftSyntax embedding is more documentation for how to use it. Can you follow me?

I disagree here. This repo is the main entry point to whoever wants to use SwiftSyntax as a Swift package dependency and I expect those to be the vast majority compared to those who contribute to the repository. So I think the documentation should primarily target adopters of SwiftSyntax. Contributors are already slightly more committed and I think we can expect them to click a link to view the “Contributing” documentation.

And then I think the contribution, license, issues and so on is added in the main readme.

I’m not entirely sure if I understand what you mean here but my idea is that the main readme is fairly lightweight. IMO “Contributing” and “License” should just be links. If the documentation to write bug reports it might fit into the main readme.

@kimdv kimdv force-pushed the kimdv/update-readme branch 3 times, most recently from cafc4ff to 1d40ebd Compare February 22, 2022 17:43
@kimdv
Copy link
Contributor Author

kimdv commented Feb 22, 2022

Exploring to use DocC would definitely be interesting but there’s a non-trivial deployment story we need to solve. We always want the latest documentation for the current main branch. But that means that we need to do one of the following

  • You need to manually rebuild the documentation when you make any changes

    • I think this is not practical
  • We need to have a CI job that generates and pushes the documentation to a different repository

    • In that case we wouldn’t have any documentation inside this repository itself, which I don’t really like but maybe having a basic README + reference to the DocC-generated documentation would be alright
    • Creating a new repository + the necessary CI job is not something we can set up in the short-term
  • We require users who wish to view the documentation to download the repository and open the documentation themselves

    • I think this raises the entry barrier of figuring out what SwiftSyntax too much because cloning/downloading the repo just to view the basic documentation seems like a fairly big commitment to me

I might have missed an option here because I’m not familiar with DocC but I would suggest that for now we stick with markdown files.

As a separate task, we could consider improving the doc comments of SwiftSyntax to generate better documentation which adopters can build themselves by invoking docc locally.

Let's wait with DocC then, and getting started with some basic documentation then.

I disagree here. This repo is the main entry point to whoever wants to use SwiftSyntax as a Swift package dependency and I expect those to be the vast majority compared to those who contribute to the repository. So I think the documentation should primarily target adopters of SwiftSyntax. Contributors are already slightly more committed and I think we can expect them to click a link to view the “Contributing” documentation.

I have tried to make folder structure so it's easy to navigate to the correct folder.

I’m not entirely sure if I understand what you mean here but my idea is that the main readme is fairly lightweight. IMO “Contributing” and “License” should just be links. If the documentation to write bug reports it might fit into the main readme.

I have tried to structure what I have been thinking of.

How to setup the CI to test the examples, I don't know 🤷‍♂️

@kimdv kimdv force-pushed the kimdv/update-readme branch 3 times, most recently from 3f7c4e6 to 7a59f00 Compare February 22, 2022 18:05
@kimdv kimdv force-pushed the kimdv/update-readme branch 4 times, most recently from 8c46f0b to d6d732d Compare February 22, 2022 18:42
> Note: SwiftSyntax is still in development, and the API is not guaranteed to
> be stable. It's subject to change without warning.

## Some Example Users
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could put those example users in the Examples folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved those, and called I Some Examples Usages (I think the Users is a typo)

@kimdv kimdv force-pushed the kimdv/update-readme branch from d6d732d to 05f3a0d Compare February 24, 2022 17:32
@kimdv kimdv requested a review from ahoppen February 24, 2022 17:33
@kimdv kimdv force-pushed the kimdv/update-readme branch from 05f3a0d to 055c807 Compare February 24, 2022 17:35
@kimdv kimdv force-pushed the kimdv/update-readme branch from 055c807 to 089e98c Compare February 24, 2022 17:46
@kimdv kimdv force-pushed the kimdv/update-readme branch 2 times, most recently from 95fe618 to afc0203 Compare March 1, 2022 18:14
@kimdv kimdv force-pushed the kimdv/update-readme branch from afc0203 to 3db552d Compare March 1, 2022 18:15
@kimdv kimdv requested a review from ahoppen March 1, 2022 18:15
@ahoppen
Copy link
Member

ahoppen commented Mar 4, 2022

@swift-ci Please test

@kimdv kimdv marked this pull request as ready for review March 4, 2022 16:29
@kimdv kimdv merged commit e22754f into swiftlang:main Mar 4, 2022
kimdv added a commit to kimdv/swift-syntax that referenced this pull request Mar 6, 2022
In swiftlang#363 we forgot to remove this
@kimdv kimdv mentioned this pull request Mar 6, 2022
@kimdv kimdv deleted the kimdv/update-readme branch March 24, 2022 10:14
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.

2 participants