Skip to content

Commit 47fa8b6

Browse files
authored
Components Rendering: Support nested readmes (#609)
* update component renderer * update component renderer * fix: names of child docs * trigger build
1 parent 2aec39f commit 47fa8b6

File tree

3 files changed

+58
-115
lines changed

3 files changed

+58
-115
lines changed

README.md

Lines changed: 44 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ Let's jump right in! Here's how to get started with our documentation.
3737
---
3838

3939
This project is part of our comprehensive ["SweetOps"](https://cpco.io/sweetops) approach towards DevOps.
40-
[<img align="right" title="Share via Email" src="https://docs.cloudposse.com/images/ionicons/ios-email-outline-2.0.1-16x16-999999.svg"/>][share_email]
41-
[<img align="right" title="Share on Google+" src="https://docs.cloudposse.com/images/ionicons/social-googleplus-outline-2.0.1-16x16-999999.svg" />][share_googleplus]
42-
[<img align="right" title="Share on Facebook" src="https://docs.cloudposse.com/images/ionicons/social-facebook-outline-2.0.1-16x16-999999.svg" />][share_facebook]
43-
[<img align="right" title="Share on Reddit" src="https://docs.cloudposse.com/images/ionicons/social-reddit-outline-2.0.1-16x16-999999.svg" />][share_reddit]
44-
[<img align="right" title="Share on LinkedIn" src="https://docs.cloudposse.com/images/ionicons/social-linkedin-outline-2.0.1-16x16-999999.svg" />][share_linkedin]
45-
[<img align="right" title="Share on Twitter" src="https://docs.cloudposse.com/images/ionicons/social-twitter-outline-2.0.1-16x16-999999.svg" />][share_twitter]
46-
47-
4840

4941

5042

@@ -64,8 +56,6 @@ It's 100% Open Source and licensed under the [Creative Commons Attribution-NonCo
6456

6557

6658

67-
68-
6959
## Usage
7060

7161

@@ -93,36 +83,66 @@ Available targets:
9383
help Help screen
9484
help/all Display help for all targets
9585
help/short This help short screen
86+
deps Install node modules
87+
deps-production Install production only node modules
88+
build Generate all static content (outputs to build/) using docker environment
89+
start Start web server locally
90+
real-clean Clean all dependencies and generated html files
91+
all Run `clean`, `deps` and `build steps
9692
9793
```
9894
<!-- markdownlint-restore -->
9995

10096

97+
## Related Projects
10198

102-
## Share the Love
99+
Check out these related projects.
103100

104-
Like this project? Please give it a ★ on [our GitHub](https://github.com/cloudposse/docs)! (it helps us **a lot**)
101+
- [Geodesic](https://github.com/cloudposse/geodesic) - Geodesic is the fastest way to get up and running with a rock solid, production grade cloud platform
105102

106-
Are you using this project or any of our other projects? Consider [leaving a testimonial][testimonial]. =)
103+
## ✨ Contributing
107104

105+
This project is under active development, and we encourage contributions from our community.
106+
Many thanks to our outstanding contributors:
108107

108+
<a href="https://github.com/cloudposse/docs/graphs/contributors">
109+
<img src="https://contrib.rocks/image?repo=cloudposse/docs&max=24" />
110+
</a>
109111

110-
## Related Projects
112+
### 🐛 Bug Reports & Feature Requests
111113

112-
Check out these related projects.
114+
Please use the [issue tracker](https://github.com/cloudposse/docs/issues) to report any bugs or file feature requests.
113115

114-
- [Geodesic](https://github.com/cloudposse/geodesic) - Geodesic is the fastest way to get up and running with a rock solid, production grade cloud platform
116+
### 💻 Developing
115117

116-
## Help
118+
If you are interested in being a contributor and want to get involved in developing this project or [help out](https://cpco.io/help-out) with our other projects, we would love to hear from you! Shoot us an [email][email].
117119

118-
**Got a question?** We got answers.
120+
In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
119121

120-
File a GitHub [issue](https://github.com/cloudposse/docs/issues), send us an [email][email] or join our [Slack Community][slack].
122+
1. **Fork** the repo on GitHub
123+
2. **Clone** the project to your own machine
124+
3. **Commit** changes to your own branch
125+
4. **Push** your work back up to your fork
126+
5. Submit a **Pull Request** so that we can review your changes
121127

122-
[![README Commercial Support][readme_commercial_support_img]][readme_commercial_support_link]
128+
**NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request!
129+
130+
### 🌎 Slack Community
131+
132+
Join our [Open Source Community][slack] on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure.
133+
134+
### 📰 Newsletter
135+
136+
Sign up for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover.
137+
138+
### 📆 Office Hours <img src="https://img.cloudposse.com/fit-in/200x200/https://cloudposse.com/wp-content/uploads/2019/08/Powered-by-Zoom.png" align="right" />
123139

124-
## DevOps Accelerator for Startups
140+
[Join us every Wednesday via Zoom][office_hours] for our weekly "Lunch & Learn" sessions. It's **FREE** for everyone!
125141

142+
## About
143+
144+
This project is maintained and funded by [Cloud Posse, LLC][website].
145+
<a href="https://cpco.io/homepage"><img src="https://cloudposse.com/logo-300x69.svg" align="right" /></a>
126146

127147
We are a [**DevOps Accelerator**][commercial_support]. We'll help you build your cloud infrastructure from the ground up so you can own it. Then we'll show you how to operate it and stick around for as long as you need us.
128148

@@ -143,52 +163,7 @@ We deliver 10x the value for a fraction of the cost of a full-time engineer. Our
143163
- **Code Reviews.** You'll receive constructive feedback on Pull Requests.
144164
- **Bug Fixes.** We'll rapidly work with you to fix any bugs in our projects.
145165

146-
## Slack Community
147-
148-
Join our [Open Source Community][slack] on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure.
149-
150-
## Discourse Forums
151-
152-
Participate in our [Discourse Forums][discourse]. Here you'll find answers to commonly asked questions. Most questions will be related to the enormous number of projects we support on our GitHub. Come here to collaborate on answers, find solutions, and get ideas about the products and services we value. It only takes a minute to get started! Just sign in with SSO using your GitHub account.
153-
154-
## Newsletter
155-
156-
Sign up for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover.
157-
158-
## Office Hours
159-
160-
[Join us every Wednesday via Zoom][office_hours] for our weekly "Lunch & Learn" sessions. It's **FREE** for everyone!
161-
162-
[![zoom](https://img.cloudposse.com/fit-in/200x200/https://cloudposse.com/wp-content/uploads/2019/08/Powered-by-Zoom.png")][office_hours]
163-
164-
## Contributing
165-
166-
### Bug Reports & Feature Requests
167-
168-
Please use the [issue tracker](https://github.com/cloudposse/docs/issues) to report any bugs or file feature requests.
169-
170-
### Developing
171-
172-
If you are interested in being a contributor and want to get involved in developing this project or [help out](https://cpco.io/help-out) with our other projects, we would love to hear from you! Shoot us an [email][email].
173-
174-
In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.
175-
176-
1. **Fork** the repo on GitHub
177-
2. **Clone** the project to your own machine
178-
3. **Commit** changes to your own branch
179-
4. **Push** your work back up to your fork
180-
5. Submit a **Pull Request** so that we can review your changes
181-
182-
**NOTE:** Be sure to merge the latest changes from "upstream" before making a pull request!
183-
184-
185-
## Copyright
186-
187-
Copyright © 2017-2023 [Cloud Posse, LLC](https://cpco.io/copyright)
188-
189-
190-
191-
166+
[![README Commercial Support][readme_commercial_support_img]][readme_commercial_support_link]
192167
## License
193168

194169
[![License](https://img.shields.io/badge/License-CC%20BY%20NC%20SA%204.0-blue.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
@@ -209,45 +184,11 @@ Distribution of substantively modified versions of this document is prohibited w
209184

210185
Distribution of the work or derivative of the work in any standard (paper) book form for commercial purposes is prohibited unless prior permission is obtained from the copyright holder.
211186

212-
213-
214-
215-
216-
217-
218-
219187
## Trademarks
220188

221189
All other trademarks referenced herein are the property of their respective owners.
222-
223-
## About
224-
225-
This project is maintained and funded by [Cloud Posse, LLC][website]. Like it? Please let us know by [leaving a testimonial][testimonial]!
226-
227-
[![Cloud Posse][logo]][website]
228-
229-
We're a [DevOps Professional Services][hire] company based in Los Angeles, CA. We ❤️ [Open Source Software][we_love_open_source].
230-
231-
We offer [paid support][commercial_support] on all of our projects.
232-
233-
Check out [our other projects][github], [follow us on twitter][twitter], [apply for a job][jobs], or [hire us][hire] to help with your cloud strategy and implementation.
234-
235-
236-
237-
### Contributors
238-
239-
<!-- markdownlint-disable -->
240-
| [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] |
241-
|---|---|---|
242-
<!-- markdownlint-restore -->
243-
244-
[osterman_homepage]: https://github.com/osterman
245-
[osterman_avatar]: https://img.cloudposse.com/150x150/https://github.com/osterman.png
246-
[goruha_homepage]: https://github.com/goruha
247-
[goruha_avatar]: https://img.cloudposse.com/150x150/https://github.com/goruha.png
248-
[aknysh_homepage]: https://github.com/aknysh
249-
[aknysh_avatar]: https://img.cloudposse.com/150x150/https://github.com/aknysh.png
250-
190+
---
191+
Copyright © 2017-2024 [Cloud Posse, LLC](https://cpco.io/copyright)
251192
[![README Footer][readme_footer_img]][readme_footer_link]
252193
[![Beacon][beacon]][website]
253194
<!-- markdownlint-disable -->
@@ -258,12 +199,9 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
258199
[jobs]: https://cpco.io/jobs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/docs&utm_content=jobs
259200
[hire]: https://cpco.io/hire?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/docs&utm_content=hire
260201
[slack]: https://cpco.io/slack?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/docs&utm_content=slack
261-
[linkedin]: https://cpco.io/linkedin?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/docs&utm_content=linkedin
262202
[twitter]: https://cpco.io/twitter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/docs&utm_content=twitter
263-
[testimonial]: https://cpco.io/leave-testimonial?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/docs&utm_content=testimonial
264203
[office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/docs&utm_content=office_hours
265204
[newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/docs&utm_content=newsletter
266-
[discourse]: https://ask.sweetops.com/?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/docs&utm_content=discourse
267205
[email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/docs&utm_content=email
268206
[commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/docs&utm_content=commercial_support
269207
[we_love_open_source]: https://cpco.io/we-love-open-source?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/docs&utm_content=we_love_open_source
@@ -274,11 +212,5 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
274212
[readme_footer_link]: https://cloudposse.com/readme/footer/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/docs&utm_content=readme_footer_link
275213
[readme_commercial_support_img]: https://cloudposse.com/readme/commercial-support/img
276214
[readme_commercial_support_link]: https://cloudposse.com/readme/commercial-support/link?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/docs&utm_content=readme_commercial_support_link
277-
[share_twitter]: https://twitter.com/intent/tweet/?text=Developer+Documentation&url=https://github.com/cloudposse/docs
278-
[share_linkedin]: https://www.linkedin.com/shareArticle?mini=true&title=Developer+Documentation&url=https://github.com/cloudposse/docs
279-
[share_reddit]: https://reddit.com/submit/?url=https://github.com/cloudposse/docs
280-
[share_facebook]: https://facebook.com/sharer/sharer.php?u=https://github.com/cloudposse/docs
281-
[share_googleplus]: https://plus.google.com/share?url=https://github.com/cloudposse/docs
282-
[share_email]: mailto:?subject=Developer+Documentation&body=https://github.com/cloudposse/docs
283215
[beacon]: https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/docs?pixel&cs=github&cm=readme&an=docs
284216
<!-- markdownlint-restore -->

README.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ contributors:
4343
github: "goruha"
4444
- name: "Andriy Knysh"
4545
github: "aknysh"
46+
- name: "Benjamin Smith"
47+
github: "Benbentwo"

scripts/docs-collator/ComponentRenderer.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,18 @@ def render(self, component):
2424
module_download_dir = os.path.join(self.download_dir, 'modules', component)
2525

2626
files = io.get_filenames_in_dir(module_download_dir, README_MD, True)
27+
files += io.get_filenames_in_dir(module_download_dir, '*.md', True)
28+
29+
images = io.get_filenames_in_dir(module_download_dir, '*.png', True)
2730

2831
for file in files:
32+
if file.endswith(CHANGELOG_MD):
33+
continue
2934
self.__render_doc(component, file)
3035

36+
for image in images:
37+
io.copy_file(image, os.path.join(self.docs_dir, component, os.path.relpath(image, module_download_dir)))
38+
3139
def __render_doc(self, component, file):
3240
module_download_dir = os.path.join(self.download_dir, 'modules')
3341

@@ -43,11 +51,12 @@ def __render_doc(self, component, file):
4351
relative_path = os.path.relpath(file, module_download_dir)
4452
result_file = os.path.join(self.docs_dir, os.path.relpath(file, module_download_dir)) # <module-name>/README.md
4553

46-
label = component
47-
title = component
54+
name = component if os.path.basename(file) == "README.md" else os.path.basename(file).replace(".md", "")
55+
label = name
56+
title = name
4857
github_edit_url = f"https://github.com/{GITHUB_REPO}/blob/master/modules/{relative_path}"
4958

50-
if len(relative_path.split('/')) > 2: # this is submodule
59+
if len(relative_path.split('/')) > 2 and relative_path.split('/')[1] != 'docs' : # this is submodule
5160
submodule_name = os.path.basename(os.path.dirname(result_file))
5261

5362
label = submodule_name

0 commit comments

Comments
 (0)