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

[Feature] Configure URL mappings in Python code rather than in Discourse #126

Open
bartaz opened this issue Mar 10, 2022 · 2 comments
Open
Assignees

Comments

@bartaz
Copy link
Contributor

bartaz commented Mar 10, 2022

For Vanilla docs we need the discourse content to be aligned with docs we have in the code. We also don't need the navigation handled and maintained in Discourse.

It would be good if we could configure URL mappings (path to discourse post) in Python rather than having to maintain empty page on discourse just to maintain a "Navigation" table there.

It seems that if we could pass URL mapping directly to discourse module it could also directly fetch the required content without the need to fetch the index topic and parse Navigation out of it.

Some "pseudo-code" suggestion to what I mean:

discourse_docs = Docs(
    parser=DocParser(
        api=DiscourseAPI(
            base_url="https://discourse.ubuntu.com/", session=session
        ),
        # instead of index_topic pass the URL mapping
        # mapping could be full discourse URLs, just paths, or maybe just post IDs
        url_mapping = {
           "pattern/notification": "/t/12345",
           "pattern/code-snippet": "/t/54321",
        },
        url_prefix="/design",
    ),
    document_template="/_layouts/docs_discourse.html",
    url_prefix="/design",
)
@anthonydillon
Copy link
Contributor

To be discussed in the infra guild meeting on the 28th of March.

@canonical canonical deleted a comment from sowasred2012 Mar 18, 2022
@anthonydillon
Copy link
Contributor

@carkod what it the property of this issue? It's not triaged without one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants