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

Fetch content of smart answers from GitHub #685

Open
nacnudus opened this issue Jul 5, 2024 · 0 comments
Open

Fetch content of smart answers from GitHub #685

nacnudus opened this issue Jul 5, 2024 · 0 comments

Comments

@nacnudus
Copy link
Contributor

nacnudus commented Jul 5, 2024

Users continue to request that all Smart Answer content be included in GovSearch.

Smart answers (aka GitHub smart answers) are composed in , and only their initial page is sent to the Publishing API, son only their initial page is currently available in GovSearch.

The content could be included in GovSearch by

  1. Fetch the HEAD of the repository
  2. Iterate through the `app/flows/smart_answer_slug_flow/**/*.erb
  3. Extract plain text from the .erb files (write a simple state machine parser according to https://ruby-doc.org/stdlib-1.9.3/libdoc/erb/rdoc/ERB.html)
  4. Append that text to the content of the initial page, which will have the slug /smart-answer-slug (dashes instead of underscores)

Example: https://www.gov.uk/calculate-agricultural-holiday-entitlement

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

No branches or pull requests

1 participant