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

Projects: project creation form configuration file example/templates #10352

Closed
agjohnson opened this issue May 24, 2023 · 8 comments · Fixed by readthedocs/ext-theme#368
Closed
Assignees
Labels
Feature New feature Improvement Minor improvement to code

Comments

@agjohnson
Copy link
Contributor

This is the third step we described in #10342

In this step, we will start to add UI to our project creation pages and show the user example/template configuration files for their project. This will have it's own set of phases, but to start we are only talking about a fairly minimal UI:

  • Project creation form wizard gets a new step that just shows the user an example configuration file to add
    • Show a template that works for most projects
    • Maybe a second/fallback example option that replicates the current defaults that we're deprecating?
    • Our documentation probably shows these same examples as well

Eventually, the later versions of this might be a little smarter, but that doesn't need to hold up design at this phase. We'll want to get this feature in front of user first. Some additions we're pushing off until later:

  • Granular configuration file examples for alternative build tools
    • We'd have a selection field with "Sphinx", "Mkdocs", etc. "Docusaurus" shows an example of using Docusaurus with our config file. This would be more direct marketing of build jobs/commands and custom doc tooling.
  • Detection of a missing configuration file without building
    • We'd need a secondary task for this, to avoid triggering and failing a build.
    • For now, okay to guide the user with steps and a failing first build might be common. This might be the case even if we check for a file existing though
@agjohnson agjohnson added Feature New feature Improvement Minor improvement to code labels May 24, 2023
@github-project-automation github-project-automation bot moved this to Planned in 📍Roadmap May 25, 2023
humitos added a commit that referenced this issue May 25, 2023
As part of the "Import Wizard" steps, we add an extra step now that shows a
simple suggestion for a config file v2 (the same we currently have in our
documentation) that uses `build.os: ubuntu-22.04` and `build.tools.python:
"3.11"`.

This is an initial work to show the value we can add to this wizard with
something pretty simple. There is more work required on the copy for this
intermediate step and the UX (I added a checkbox for now to force the user to
read the message, not ideal, but works for now).

Also, it would be good to find a way to highlight the YAML syntaxis using nice
colors and add more useful copy to that intermediate page.

Related #10352
humitos added a commit that referenced this issue Jun 6, 2023
* Project: suggest a simple config file on project import wizard

As part of the "Import Wizard" steps, we add an extra step now that shows a
simple suggestion for a config file v2 (the same we currently have in our
documentation) that uses `build.os: ubuntu-22.04` and `build.tools.python:
"3.11"`.

This is an initial work to show the value we can add to this wizard with
something pretty simple. There is more work required on the copy for this
intermediate step and the UX (I added a checkbox for now to force the user to
read the message, not ideal, but works for now).

Also, it would be good to find a way to highlight the YAML syntaxis using nice
colors and add more useful copy to that intermediate page.

Related #10352

* Template: update link

* Template: add more style to the wizard config suggestion

* Template: show the file as code

* Form: swap label/help_text

* Tests: update wizard to add a new step

* Remove checkbox from suggested YAML file page

* Suggested YAML file CSS style

* Test: re-add `self.data` to test class

* Use CSS class to style the YAML shown at import step

* Add required variable in tests

* Minor style for import config step

* Split phrase to avoid scrolling
@ericholscher
Copy link
Member

Is this what we just shipped?

@agjohnson
Copy link
Contributor Author

We shipped the first part of this work, but the other half of this issue still needs some discussion and planning. We can keep this issue around or break out issues for the remaining parts of this issue that we haven't added yet.

The most important is that the next update to the project creation form wizard will be that the configuration file will use dynamic content to show the user relevant examples for the tool they are trying to use for their project. This might just be a new dashboard thing only though.

@humitos
Copy link
Member

humitos commented Mar 12, 2024

This could be slightly related to #11187 in some way.

@ericholscher
Copy link
Member

Goal here is to do this after improving our docs for other tool support.

@humitos humitos self-assigned this Jun 4, 2024
@agjohnson
Copy link
Contributor Author

For the initial pass here, we can add to the list of Example configuration for dropdown with basic examples -- anything that requires just our configurartion file.

The next phase of this would be to link out to documentation pages for complex examples -- anything that requires additional JS/template/etc changes. We need documentation pages for these however.

@humitos
Copy link
Member

humitos commented Jun 6, 2024

I jumped into this today and I found it requires readthedocs/ext-theme#184 as well. The frontend is not prepared to add another config file example easily, unfortunately. I will jump there and see if I find an easy way to do this.

@agjohnson
Copy link
Contributor Author

Ah I just reviewed your PR, I asked about this. I think it should be easy enough to trigger the tabs from the dropdown, and I'd like to retain the dropdown if possible. I'll poke this really quick, we can always revert to a dropdown later if it is complicated.

@agjohnson
Copy link
Contributor Author

agjohnson commented Jun 6, 2024

Actually, yeah, it was super simple.

Screencast.from.2024-06-06.14-33-51.webm

Tab content is example only, you can reuse what you did.

diff --git a/readthedocsext/theme/templates/projects/import_config.html b/readthedocsext/theme/templates/projects/import_config.html
index acc68dc..0454316 100644
--- a/readthedocsext/theme/templates/projects/import_config.html
+++ b/readthedocsext/theme/templates/projects/import_config.html
@@ -24,8 +24,9 @@
       <input type="hidden" name="tool" value="sphinx">
       <span class="text">Sphinx</span>
       <i class="dropdown icon"></i>
-      <div class="menu">
-        <div class="item" data-value="sphinx">Sphinx</div>
+      <div class="menu" data-bind="semanticui: { tabmenu: {}}">
+        <div class="item" data-tab="sphinx">Sphinx</div>
+        <div class="item" data-tab="mkdocs">Mkdocs</div>

         {% comment %}
           Adding a second option here will require a bit of JS or FUI:
@@ -40,6 +41,9 @@
     </div>
   </div>

+  <div class="ui tab" data-tab="sphinx">Sphinx</div>
+  <div class="ui tab" data-tab="mkdocs">Mkdocs</div>
+
   <div class="ui mini padded inverted scrolling segment">
     <div class="ui top attached label">
       <code>.readthedocs.yaml</code>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature Improvement Minor improvement to code
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants