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

Allow for external links in articles page #2028

Closed
EmilHvitfeldt opened this issue Jan 21, 2022 · 3 comments · Fixed by #2576
Closed

Allow for external links in articles page #2028

EmilHvitfeldt opened this issue Jan 21, 2022 · 3 comments · Fixed by #2576
Labels
articles ✍️ feature a feature request or enhancement
Milestone

Comments

@EmilHvitfeldt
Copy link
Member

EmilHvitfeldt commented Jan 21, 2022

In recipes, we have a couple of articles that got moved away from the package itself to other sites. It would be nice if we could link externally from the articles page.

Below is an old yaml section that can't be updated to bs5

  - text: "Articles"
    menu:
      - text: "Selecting Variables"
        href: articles/Selecting_Variables.html
      - text: "Custom Steps"
        href: https://www.tidymodels.org/learn/develop/recipes/
      - text: "The Order of Steps"
        href: articles/Ordering.html
      - text: "Dummy Variables and Interactions"
        href: articles/Dummies.html
      - text: "Column Roles"
        href: articles/Roles.html
      - text: "On Skipping Steps"
        href: articles/Skipping.html
      - text: "Subsampling for Class Imbalances"
        href: https://www.tidymodels.org/learn/models/sub-sampling/
      - text: "Multivariate Analysis using Partial Least Squares"
        href: https://www.tidymodels.org/learn/models/pls/

Below is what would be nice if it was possible (imaginary syntax)

articles:
- title: About recipe Steps
  navbar: ~
  contents:
  - Selecting_Variables
  - Ordering
  - Dummies
  - Roles
  - Skipping
- title: Developer
  contents:
  - text: Custom Steps
    desc: Write a new recipe step for data preprocessing.
    href: https://www.tidymodels.org/learn/develop/recipes/
- title: Examples
  contents:
  - text: Subsampling for Class Imbalances
    desc: Improve model performance in imbalanced data sets through undersampling or oversampling.
    href: https://www.tidymodels.org/learn/models/sub-sampling/
  - text: Multivariate Analysis using Partial Least Squares
    desc: Build and fit a predictive model with more than one outcome.
    href: https://www.tidymodels.org/learn/models/pls/
@hadley hadley added feature a feature request or enhancement articles ✍️ labels May 31, 2022
@hadley
Copy link
Member

hadley commented Apr 17, 2024

We should copy the syntax we used for references.

@hadley hadley added this to the 2.1.0 milestone Apr 22, 2024
@hadley
Copy link
Member

hadley commented Apr 24, 2024

The syntax for external reference topics is just pkg::topic_name, which obviously isn't going to apply to articles.

Presumably you'll also want to be able to mix and match within a section, e.g.

articles:
- title: About recipe Steps
  navbar: ~
  contents:
  - Selecting_Variables
  - Ordering
  - Dummies
  - Roles
  - Skipping
  - text: Custom Steps
    desc: Write a new recipe step for data preprocessing.
    href: https://www.tidymodels.org/learn/develop/recipes/

That's going to make parsing rather complicated, since contents can use -,starts_with() etc, so maybe it would be simpler to have an external-articles section that provides a lookup table:

articles:
- title: About recipe Steps
  navbar: ~
  contents:
  - Selecting_Variables
  - Ordering
  - Dummies
  - Roles
  - Skipping
- title: Developer
  contents:
  - custom
- title: Examples
  contents:
  - subsampling
  - pls

external-articles:
- name: subsampling
  text: Subsampling for Class Imbalances
  desc: Improve model performance in imbalanced data sets through undersampling or oversampling.
  href: https://www.tidymodels.org/learn/models/sub-sampling/
- name: pls
  text: Multivariate Analysis using Partial Least Squares
  desc: Build and fit a predictive model with more than one outcome.
  href: https://www.tidymodels.org/learn/models/pls/
- name: custom 
  text: Custom Steps
  desc: Write a new recipe step for data preprocessing.
  href: https://www.tidymodels.org/learn/develop/recipes/

What do you think of that @EmilHvitfeldt?

@EmilHvitfeldt
Copy link
Member Author

that sounds good to me

hadley added a commit that referenced this issue May 23, 2024
hadley added a commit that referenced this issue May 24, 2024
SebKrantz pushed a commit to SebKrantz/pkgdown that referenced this issue Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
articles ✍️ feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants