Skip to content

Move mkdocs work over from julz/mkdocs branch#3551

Merged
knative-prow-robot merged 15 commits into
knative:mkdocsfrom
julz:mkmain
May 11, 2021
Merged

Move mkdocs work over from julz/mkdocs branch#3551
knative-prow-robot merged 15 commits into
knative:mkdocsfrom
julz:mkmain

Conversation

@julz
Copy link
Copy Markdown
Contributor

@julz julz commented May 11, 2021

Fixes #3547.

Moves over the mkdocs work from julz/mkdocs, and re-converts serving/eventing docs to mkdocs.

This is almost entirely automated. I copied over mkdocs.yml, extra.css,
overrides/* (the home page), macros.py, index.md, and the getting started
directory and then ran the following scripts:

  • mkhugo to convert shortcodes to nice mkdocs markdown.
  • Rename _index.md to README.md where it did not contain a readfile shortcode.
  • h1fi to add top-level headers where missing
    (looks nicer on github, and makes mkdocs material search results look nicer -- this is the
    majority of the diff 🤷).
  • mknav to generate the nav section of the yaml
    for serving and eventing based on the weights in the existing metadata (and
    then a bit of manual touch-up after to make the structure a bit nicer).

Having done this - since the scripts had done all the work of converting them - I dropped the excludes
from mkdocs.yml that had been hiding most of the samples \o/.

To test, check out the branch and run mkdocs serve. You should see no errors
(other than some broken in-page links we need to fix up - these look like they're mostly missing aliases),
and you should be able to correctly click through all the pages.

All the above scripts are idempontent, so it should be fine to rerun them to
fix up any outstanding PRs that we want to cherry-pick after this.

/assign @omerbensaadon @csantanapr

@knative-prow-robot knative-prow-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 11, 2021
@google-cla google-cla Bot added the cla: yes Indicates the PR's author has signed the CLA. label May 11, 2021
@omerbensaadon
Copy link
Copy Markdown

Great work on this!

mknav to generate the nav section of the yaml
for serving and eventing based on the weights in the existing metadata (and
then a bit of manual touch-up after to make the structure a bit nicer).

It seems to me that the Serving section still contains some of the editorial decisions we made RE: navigation... is that meant to be there?

@julz
Copy link
Copy Markdown
Contributor Author

julz commented May 11, 2021

Yeah that was the touch up I mentioned, decided it felt like a better start to create a couple folders, but I'd happily pull it out and land it separately if you like 🤷‍♂️

@omerbensaadon
Copy link
Copy Markdown

@julz that's ok, I can write a story to make this nav match the nav on knative.dev, just wanted to make sure this wasn't a failure of the script. Not a big lift, no worries.

Copy link
Copy Markdown

@omerbensaadon omerbensaadon left a comment

Choose a reason for hiding this comment

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

Looks great for a first pass!

We've got a few things we'll need to touch up with a fine-tooth-comb in the coming weeks but this is a fantastic start.

Thanks @julz not sure how we'd do this without you!!

CC: @csantanapr

[KafkaChannel - Consolidated](https://github.com/knative-sandbox/eventing-kafka/tree/{{< branch >}}/pkg/channel/consolidated/README.md) | Proof of Concept | None | Channels are backed by [Apache Kafka](http://kafka.apache.org/) topics. The original Knative KafkaChannel implementation which utilizes a single combined Kafka Producer / Consumer deployment.
[KafkaChannel - Distributed](https://github.com/knative-sandbox/eventing-kafka/tree/{{< branch >}}/pkg/channel/distributed/README.md) | Proof of Concept | None | Channels are backed by [Apache Kafka](http://kafka.apache.org/) topics. An alternate KafkaChannel implementation, contributed by SAP's [Kyma](https://kyma-project.io/) project, which provides a more granular deployment of Producers / Consumers.
[NatssChannel](https://github.com/knative-sandbox/eventing-natss/tree/{{< branch >}}/config/README.md) | Proof of Concept | None | Channels are backed by [NATS Streaming](https://github.com/nats-io/nats-streaming-server#configuring).
[InMemoryChannel](https://github.com/knative/eventing/tree/{{ branch }}/config/channels/in-memory-channel/README.md) | Proof of Concept | None | In-memory channels are a best effort Channel. They should NOT be used in Production. They are useful for development.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Does {{ branch }} work the same was as the old {{ < branch > }} ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks like it does... how?!

Copy link
Copy Markdown
Contributor Author

@julz julz May 11, 2021

Choose a reason for hiding this comment

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

sort of, the old branch did some magic to get the branch via what directory it had been git cloned-ed in to during the build in processresourcefiles.sh . I think our build will be a bit less complicated so we can just use a variable defined in mkdocs.yml (but we'll fully define this when we get to building versioned docs).


Tutorial on how to build and deploy a `KafkaSource` [Eventing source](../../../sources/README.md) using a Knative Serving `Service`.

## Prerequisites
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks like numbering breaks using code blocks, have seen this in other places, we can take care of it during cleanup

Copy link
Copy Markdown
Contributor Author

@julz julz May 11, 2021

Choose a reason for hiding this comment

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

ah yeah, I think this is slightly invalid markdown that hugo copes with better. Deleting the line above the code block solves it iirc


```bash
kubectl apply --filename {{< artifact org="knative-sandbox" repo="eventing-kafka-broker" file="eventing-kafka-controller.yaml" >}}
kubectl apply --filename {{ artifact(org="knative-sandbox", repo="eventing-kafka-broker", file="eventing-kafka-controller.yaml") }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why does this work?!

Copy link
Copy Markdown
Contributor Author

@julz julz May 11, 2021

Choose a reason for hiding this comment

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

def artifact(repo, file, org="knative"):
:)

@omerbensaadon
Copy link
Copy Markdown

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label May 11, 2021
@omerbensaadon omerbensaadon added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 11, 2021
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: omerbensaadon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@csantanapr
Copy link
Copy Markdown
Member

Nice work @julz 🙌

@julz julz mentioned this pull request May 12, 2021
RichardJJG pushed a commit to RichardJJG/docs that referenced this pull request Jun 30, 2021
* initial move over

* Fix up index page names

* Add version variables

* Escape macro syntax

* Automatic fixups with mkhugo

* Drop no-longer-needed excludes

* Rename more _index files

* Move broker-configmaps.md a README.md

avoids a directory with no index/readme

* Autogenerate Eventing nav

* Fix markdown

* Update Serving nav

* Add h1 headers

Makes things look nicer in github, and makes search work more accurately
in mkdocs

* Unexclude all samples

* Correct client link

* Fix gitignore, skip hugo tests
RichardJJG pushed a commit to RichardJJG/docs that referenced this pull request Jul 1, 2021
* initial move over

* Fix up index page names

* Add version variables

* Escape macro syntax

* Automatic fixups with mkhugo

* Drop no-longer-needed excludes

* Rename more _index files

* Move broker-configmaps.md a README.md

avoids a directory with no index/readme

* Autogenerate Eventing nav

* Fix markdown

* Update Serving nav

* Add h1 headers

Makes things look nicer in github, and makes search work more accurately
in mkdocs

* Unexclude all samples

* Correct client link

* Fix gitignore, skip hugo tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. kind/mkdocs lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants