Skip to content

Commit f79f82d

Browse files
committed
Adding files to publish two separate gitbooks: en + jp
1 parent f339a49 commit f79f82d

20 files changed

Lines changed: 378 additions & 169 deletions

‎.github/workflows/book.yml‎

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,43 @@
1-
name: Book ToC Generation
1+
name: Gitbook Generation
22

33
on:
44
push:
55
branches:
66
- "main"
77
- "book-staging"
8-
- "japanese-translation-v1"
8+
- "translation-japanese"
99

1010
jobs:
1111
book-toc-generation:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
with:
1717
ref: ${{ github.head_ref }}
1818

19-
- uses: actions/setup-ruby@v1
19+
- uses: ruby/setup-ruby@v1
2020
with:
2121
ruby-version: '2.6'
22+
working-directory: 'book/scripts/'
23+
bundler-cache: true
2224

23-
- name: Install ruby dependencies
25+
- name: Determine book language
2426
run: |
25-
cd book/
26-
gem install bundler
27-
bundle install
27+
[[ "$GITHUB_REF_NAME" == "book-jp" ]] && book_language="jp" || book_language="en"
28+
echo "BOOK_LANGUAGE=$book_language" >> $GITHUB_ENV
2829
2930
- name: Generate ToC
3031
run: |
31-
cd book/
32-
ruby generate_toc.rb
32+
cd book/scripts/
33+
ruby generate_toc.rb $BOOK_LANGUAGE
34+
echo "Generated book for: $BOOK_LANGUAGE" >> $GITHUB_STEP_SUMMARY
3335
34-
- name: Commit new ToC to book/toc.md
36+
- name: Copy .gitbook.yml to root
37+
run: |
38+
cp book/$BOOK_LANGUAGE/.gitbook.yaml .
39+
40+
- name: Commit updated files for the book
3541
uses: stefanzweifel/git-auto-commit-action@v4
3642
with:
37-
commit_message: Writing new ToC for the book
43+
commit_message: Writing updated files for the book

‎.github/workflows/link-checker.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ jobs:
2121
id: lc
2222
uses: peter-evans/link-checker@v1
2323
with:
24-
args: -v -d . -x "http://creativecommons.org/licenses|https://isc-inviter.herokuapp.com|https://github.com/rcs/rcs-viewer/pull/81|fearlesschangepatterns.com|https://ulir.ul.ie/bitstream/handle/10344/4443/Stol_2014_inner.pdf|https://docs.github.com/en/rest/metrics/statistics|https://docs.github.com/en/rest/search#search-repositories" README.md patterns/ -r
24+
args: -v -d . -x "http://creativecommons.org/licenses|https://isc-inviter.herokuapp.com|https://github.com/rcs/rcs-viewer/pull/81|fearlesschangepatterns.com|https://ulir.ul.ie/bitstream/handle/10344/4443/Stol_2014_inner.pdf|https://docs.github.com/en/rest/metrics/statistics|https://docs.github.com/en/rest/search#search-repositories" README.md patterns/ translation/ -r
2525
- name: Fail if there were link errors
2626
run: exit ${{ steps.lc.outputs.exit_code }}

‎book/README.md‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Whenever changes to the [InnerSource Patterns][InnerSourcePatterns] GitHub repos
44

55
## Where is the book published?
66

7-
The most up-to-date version of the book is available for readers/consumers at [patterns.innersourcecommons.org][book_production].
7+
The most up-to-date version of the book is available for readers at [patterns.innersourcecommons.org][book_production].
88

99
We also have a [Staging version][book_staging], used by the editors/producers of the book for testing purposes. If you want to make any structural changes to the book, please send a PR to merge your changes into the `book-staging` branch. That way we can test your changes on the Staging version first, before they go live.
1010

@@ -14,15 +14,25 @@ The book contains patterns of maturity **Structured** (Level 2) or **Validated**
1414

1515
## How does it work?
1616

17-
The `./book` folder contains generator scripts and some extra content required to create the gitbook.
17+
The `/book` folder contains generator scripts and extra content required to create the gitbook.
1818

19-
- `/.gitbook.yaml` - Holds basic configuration for the gitbook service. This never needs to be changed.
20-
- `/book/toc.md` - An auto-generated table of contents (ToC) for the book i.e. a list of all pages and patterns that are part of the book. The ToC is what you see on the left-hand-side menu in gitbooks.
21-
- `/book/generate_toc.rb` - Takes patterns of maturity **Structured** and **Validated**, extracts title and patlet, and injects this info into `/book/toc_template.md`. The output is written to `/book/toc.md`.
22-
- `.github/workflows/book.yml` - A GitHub Action that triggers the execution of `/book/generate_toc.rb`.
23-
- `/book/introduction.md` - The introduction to our book. This content is what the reader sees first when they open the book. The current content is based on [README.md](../README.md). We may need to modify this content even further, to address the readers of the book more specifically, rather than the readers of our GitHub repository.
24-
- `/book/contribute.md` - Information about how to contribute to this book.
25-
- `/book/explore-patterns.md` - Dedicated page in the book that highlights the mind map of all patterns.
19+
The below outlines the function of the main files used in the gitbook generation:
20+
21+
- `.github/workflows/book.yml` - A GitHub Action that triggers all scripts required to generate the book.
22+
- `/book/scripts/generate_toc.rb` - This script generates the table of contents (ToC) for the book. It takes patterns of maturity **Structured** and **Validated**, extracts title and patlet, and injects this info into `/book/en/toc_template.md`. The output is written to `/book/en/toc.md`. The ToC is what you see on the left-hand-side menu in the gitbook.
23+
- `/book/en/.gitbook.yaml` - Holds basic configuration for the gitbook service. This file is copied to the root of the repo, if the English book is generated.
24+
- `/book/en/introduction.md` - The introduction to our book. This is what the reader sees first when they open the book. *Note:* The current content is based on [README.md](../README.md). We may need to modify this content even further, to address the readers of the book more specifically, rather than the readers of our GitHub repository.
25+
- `/book/en/contribute.md` - Information about how to contribute to this book.
26+
- `/book/en/explore-patterns.md` - A page in the book that highlights the mind map of all patterns.
27+
28+
The book is generated in multiple languages. The extra content for each language is located in language-specific folders such as `/book/en` and `/book/jp`.
29+
30+
### Triggering the book generation
31+
32+
Depending on which branch a change is merged into, a different book is generated:
33+
34+
* changes merged to `main` branch: triggers the book generation for the **English** book.
35+
* changes merged to `translation-japanese` branch: triggers the book generation for the **Japanese** book.
2636

2737
## Objectives of the book
2838

@@ -33,7 +43,7 @@ There are a couple of good reasons to publish the InnerSource patterns as a gitb
3343
* (consumers) have something that is “nicer” to read than things on GitHub
3444
* (consumers) search for keywords across all patterns
3545
* (consumers) export book as PDF and read on other devices
36-
* (consumers) have stable URLs for patterns that can be used as references in other material e.g. from the Learning Path (i.e. even if the files move in the folder structure in the GitHub repo, the URL of the pattern stay the same)
46+
* (consumers) have stable URLs for patterns that can be used as references in other material e.g. from the Learning Path (i.e. even if the files move in the folder structure in the GitHub repo, we can keep the URL of the pattern in the book the same)
3747
* (producers) a motivation for pattern authors and all contributors to level up patterns from 1-initial, as only 2-structured and 3-validated are published in the book
3848
* (producers) a motivation for us to introduce more specific quality guidelines for level 2+3, so that we can be even more proud of the content in the book :)
3949
* (producers) learn which patterns are most interesting for readers (e.g. through Google Analytics)

‎book/en/.gitbook.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
root : ./
2+
3+
structure:
4+
readme: book/en/introduction.md
5+
summary: book/en/toc.md
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎book/en/toc.md‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Table of Contents
2+
3+
<!--
4+
Do not edit toc.md directly!!!
5+
Instead edit toc_template.md
6+
-->
7+
8+
<!--
9+
NOTE:
10+
Paths in here are relative to this file, and not relative to the root specified in .gitbook.yaml.
11+
-->
12+
13+
* [Introduction](../book/introduction.md)
14+
* [Table of Contents](../book/toc.md)
15+
* [Explore Patterns](../book/explore-patterns.md)
16+
* [Contribute to this book](../book/contribute.md)
17+
18+
![Mind Map of InnerSource Patterns](../pattern-categorization/innersource-program-mind-map.png)
19+
20+
## Patterns <a id="p"></a>
21+
22+
* [30 Day Warranty](../../patterns/2-structured/30-day-warranty.md) - When accepting contributions from outside of your own team, there is a natural aversion to taking responsibility for code not written by the team itself. Through the 30 Day Warranty the contributing team consents to provide bug fixes to the receiving team, which will increase the level of trust between both teams and makes it more likely that contributions get accepted.
23+
* [Common Requirements](../../patterns/2-structured/common-requirements.md) - Common code in a shared repository isn't meeting the needs of all the project-teams that want to use it; this is solved through requirements alignment and refactoring.
24+
* [Communication Tooling](../../patterns/2-structured/project-setup/communication-tooling.md) - An InnerSource project is being used outside the original development team but users are having trouble getting help and getting in touch with the project team. The idea is to set up and document standard communication tooling that allows for discussions to become visible, archived and searchable.
25+
* [Contracted Contributor](../../patterns/2-structured/contracted-contributor.md) - Associates wanting to contribute to InnerSource are discouraged from doing so by their line management. Relief is provided by formal contracts and agreements.
26+
* [Core Team](../../patterns/2-structured/core-team.md) - Even when an InnerSource project is widely needed, contributions and usage may be hindered because the project is difficult to work with. Establish a core team that is dedicated to take care of the project's fundamental items. Their work enables contributors to add and use the features that provide value to their scenarios.
27+
* [Cross-Team Project Valuation](../../patterns/2-structured/crossteam-project-valuation.md) - It's hard to sell the value of cross-team InnerSource projects that don't provide a direct impact on company revenue. Here's a data-driven way to represent your project that both articulates its value and amplifies it.
28+
* [Dedicated Community Leader](../../patterns/2-structured/dedicated-community-leader.md) - Select people with both communications and technical skills to lead the communities to ensure success in starting an InnerSource initiative.
29+
* [Document your Guiding Principles](../../patterns/2-structured/document-your-guiding-principles.md) - The usual InnerSource explanation of "applying open source best practices inside an organisation" does not work well with people lacking an open source background. As a remedy the most important principles of InnerSource get documented and published widely.
30+
* [Gig Marketplace](../../patterns/2-structured/gig-marketplace.md) - Establish a marketplace by creating an intranet website that lists specific InnerSource project needs as "Gigs" with explicit time and skill requirements. This will enable managers to better understand their employee’s time commitment and professional benefits thereby increasing the likelihood of garnering approval to make InnerSource contributions.
31+
* [InnerSource License](../../patterns/2-structured/innersource-license.md) - Two legal entities that belong to the same organization want to share software source code with each other but they are concerned about the implications in terms of legal liabilities or cross-company accounting.
32+
* [InnerSource Portal](../../patterns/2-structured/innersource-portal.md) - Potential contributors cannot easily discover InnerSource projects that they are interested in. By creating an intranet website that indexes all available InnerSource project information you enable contributors to learn about projects that might interest them and InnerSource project owners to attract an outside audience.
33+
* [Issue Tracker Use Cases](../../patterns/2-structured/project-setup/issue-tracker.md) - The InnerSource host team fails to make not only plans and progress but also context for changes transparent. This is solved by increasing the use cases for the project issue tracker to also serve brainstorming, implementation discussion, and feature design.
34+
* [Maturity Model](../../patterns/2-structured/maturity-model.md) - Teams have started adopting InnerSource. The practice is spreading to multiple departments. However, the understanding of what constitutes an InnerSource project varies. The solution is to provide a maturity model to allow for teams to go through a self check and discover patterns and practices that they are not yet aware of.
35+
* [Praise Participants](../../patterns/2-structured/praise-participants.md) - After an inner source contribution, it's important to thank the contributor for their time and effort. This pattern gives guidance that not only effectively acknowledges the contribution but also engenders further engagement from the contributor and others.
36+
* [Repository Activity Score](../../patterns/2-structured/repository-activity-score.md) - Potential contributors want to find active InnerSource projects in need of their help. By calculating a repository activity score for each project, a ranked list of projects can be created (e.g. on the InnerSource Portal), so that potential contributors can more easily determine which project they want to contribute to.
37+
* [Review Committee](../../patterns/2-structured/review-committee.md) - The InnerSource working model is a radical departure from more traditional approaches, for developers and managers alike. By establishing a review committee as an interface between the InnerSource initiative and all senior managers of business units participating in it, the latter are more likely to familiarise themselves with the initiative and support it, as it affords them a certain level of oversight and control without fostering micromanagement.
38+
* [Service vs. Library](../../patterns/2-structured/service-vs-library.md) - Teams in a DevOps environment may be reluctant to work across team boundaries on common code bases due to ambiguity over who will be responsible for responding to service downtime. The solution is to realize that often it's possible to either deploy the same service in independent environments with separate escalation chains in the event of service downtime or factor a lot of shared code out into one library and collaborate on that.
39+
* [Standard Base Documentation](../../patterns/2-structured/project-setup/base-documentation.md) - New contributors to an InnerSource project have a hard time figuring out who maintains the project, what to work on, and how to contribute. Providing documentation in standard files like README.md/CONTRIBUTING.md enables a self service process for new contributors, so that they can find the answers to the most common questions on their own.
40+
* [Start as an Experiment](../../patterns/2-structured/start-as-experiment.md) - Start your InnerSource initiative as a time limited experiment to make it easier for managers unfamiliar with InnerSource to endorse and support the initiative.
41+
* [Transparent Cross-Team Decision Making using RFCs](../../patterns/2-structured/transparent-cross-team-decision-making-using-rfcs.md) - InnerSource projects that want to achieve high participation rates and make the best possible decisions for everybody involved need to find ways to create participatory systems throughout the full software lifecycle. Publishing internal Requests for Comments (RFCs) documents allows for discussions early on in the design process, and increases the chances to build solutions with a high degree of commitment from all involved parties.
42+
* [Trusted Committer](../../patterns/2-structured/trusted-committer.md) - Many InnerSource projects will find themselves in a situation where they consistently receive feedback, features, and bug-fixes from contributors. In these situations, project maintainers seek ways to recognize and reward the work of the contributor above and beyond single contributions.
43+
44+
## Appendix
45+
46+
* [Pattern Template](../meta/pattern-template.md)
47+
* Extras
48+
* [README Template](../patterns/2-structured/project-setup/templates/README-template.md)
49+
* [CONTRIBUTING Template](../patterns/2-structured/project-setup/templates/CONTRIBUTING-template.md)
50+
51+
## Resources
52+
53+
* [This book on GitHub](https://github.com/InnerSourceCommons/InnerSourcePatterns)
54+
* [InnerSource Commons](http://innersourcecommons.org)

‎book/en/toc_template.md‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Table of Contents
2+
3+
<!--
4+
Do not edit toc.md directly!!!
5+
Instead edit toc_template.md
6+
-->
7+
8+
<!--
9+
NOTE:
10+
Paths in here are relative to this file, and not relative to the root specified in .gitbook.yaml.
11+
-->
12+
13+
* [Introduction](./introduction.md)
14+
* [Table of Contents](./toc.md)
15+
* [Explore Patterns](./explore-patterns.md)
16+
* [Contribute to this book](./contribute.md)
17+
18+
![Mind Map of InnerSource Patterns](../../pattern-categorization/innersource-program-mind-map.png)
19+
20+
## Patterns <a id="p"></a>
21+
22+
<<PATTERS_HERE>>
23+
24+
## Appendix
25+
26+
* [Pattern Template](../../meta/pattern-template.md)
27+
* Extras
28+
* [README Template](../../patterns/2-structured/project-setup/templates/README-template.md)
29+
* [CONTRIBUTING Template](../../patterns/2-structured/project-setup/templates/CONTRIBUTING-template.md)
30+
31+
## Resources
32+
33+
* [This book on GitHub](https://github.com/InnerSourceCommons/InnerSourcePatterns)
34+
* [InnerSource Commons](http://innersourcecommons.org)

‎book/jp/.gitbook.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
root : ./
2+
3+
structure:
4+
readme: book/jp/introduction.md
5+
summary: book/jp/toc.md
6+

0 commit comments

Comments
 (0)