Merge pull request #1837 from marcosnils/feat/docs_os_select

Attempt to automatically select OS tab based on user user-agent
This commit is contained in:
Gerhard Lazu 2022-03-24 23:10:32 +00:00 committed by GitHub
commit c4104626c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 6 deletions

View File

@ -42,14 +42,14 @@ cuefmt: # Format all cue files
.PHONY: cuelint .PHONY: cuelint
cuelint: cuefmt # Lint and format all cue files cuelint: cuefmt # Lint and format all cue files
@test -z "$$(git status -s . | grep -e "^ M" | grep .cue | cut -d ' ' -f3 | tee /dev/stderr)" @test -z "$$(git status -s . | grep -e "^ M" | grep "\.cue" | cut -d ' ' -f3 | tee /dev/stderr)"
.PHONY: shellcheck .PHONY: shellcheck
shellcheck: # Run shellcheck shellcheck: # Run shellcheck
shellcheck $$(find . -type f \( -iname \*.bats -o -iname \*.bash -o -iname \*.sh \) -not -path "*/node_modules/*" -not -path "*/bats-*/*") shellcheck $$(find . -type f \( -iname \*.bats -o -iname \*.bash -o -iname \*.sh \) -not -path "*/node_modules/*" -not -path "*/bats-*/*")
.PHONY: lint .PHONY: lint
lint: shellcheck cuelint golint docslint # Lint everything lint: shellcheck cuelint golint docslint mdlint # Lint everything
.PHONY: integration .PHONY: integration
integration: core-integration universe-test doc-test # Run all integration tests integration: core-integration universe-test doc-test # Run all integration tests
@ -82,6 +82,10 @@ docs: dagger # Generate docs
docslint: docs # Generate & lint docs docslint: docs # Generate & lint docs
@test -z "$$(git status -s . | grep -e "^ M" | grep docs/reference | cut -d ' ' -f3 | tee /dev/stderr)" @test -z "$$(git status -s . | grep -e "^ M" | grep docs/reference | cut -d ' ' -f3 | tee /dev/stderr)"
.PHONY: mdlint
mdlint: # Markdown lint for web
@markdownlint ./docs README.md
.PHONY: web .PHONY: web
web: # Run the website locally web: # Run the website locally
yarn --cwd "./website" install yarn --cwd "./website" install

View File

@ -31,8 +31,11 @@ You can use a local socket in an action:
import Tabs from '@theme/Tabs'; import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem'; import TabItem from '@theme/TabItem';
import BrowserOnly from '@docusaurus/BrowserOnly';
<Tabs defaultValue="unix" groupId="client-env"> <BrowserOnly>
{() =>
<Tabs defaultValue={ window.navigator.userAgent.indexOf('Win') != -1 ? 'windows': 'unix'} groupId="client-env">
<TabItem value="unix" label="Linux/macOS"> <TabItem value="unix" label="Linux/macOS">
@ -48,6 +51,8 @@ import TabItem from '@theme/TabItem';
</TabItem> </TabItem>
</Tabs> </Tabs>
}
</BrowserOnly>
## Environment variables ## Environment variables

View File

@ -147,7 +147,7 @@ Bob:
``` ```
The output here is a product of _*unifying*_ the `#Person` _definition_ with an object that contains _concrete values_ each of which is the product of unifying the concrete value with the _types_ and _constraints_ declared by the field in the definition. [Try it in the CUE playground](https://cuelang.org/play/?id=nAUx1-VlrY4#cue@export@yaml) The output here is a product of _unifying_ the `#Person` _definition_ with an object that contains _concrete values_ each of which is the product of unifying the concrete value with the _types_ and _constraints_ declared by the field in the definition. [Try it in the CUE playground](https://cuelang.org/play/?id=nAUx1-VlrY4#cue@export@yaml)
### Default Values and the Nature of Inheritance ### Default Values and the Nature of Inheritance

View File

@ -11,8 +11,14 @@ This guide shows you the Dagger way.
Within 5 minutes, you will have a local CI/CD loop and run your first test & build pipeline. Within 5 minutes, you will have a local CI/CD loop and run your first test & build pipeline.
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
import BrowserOnly from '@docusaurus/BrowserOnly';
<Tabs defaultValue="macos" <BrowserOnly>
{() =>
<Tabs defaultValue={
window.navigator.userAgent.indexOf('Linux') != -1 ? 'linux':
window.navigator.userAgent.indexOf('Win') != -1 ? 'windows':
'macos'}
groupId="os" groupId="os"
values={[ values={[
{label: 'macOS', value: 'macos'}, {label: 'Linux', value: 'linux'}, {label: 'Windows', value: 'windows'}, {label: 'macOS', value: 'macos'}, {label: 'Linux', value: 'linux'}, {label: 'Windows', value: 'windows'},
@ -274,6 +280,9 @@ It becomes even more obvious when the change is not as straightforward as knowin
</TabItem> </TabItem>
</Tabs> </Tabs>
}
</BrowserOnly>
:::tip :::tip
Now that we are comfortable with our local CI/CD loop, let us configure a remote CI environment in the second part. Now that we are comfortable with our local CI/CD loop, let us configure a remote CI environment in the second part.

View File

@ -147,7 +147,7 @@ Bob:
``` ```
The output here is a product of _*unifying*_ the `#Person` _definition_ with an object that contains _concrete values_ each of which is the product of unifying the concrete value with the _types_ and _constraints_ declared by the field in the definition. [Try it in the CUE playground](https://cuelang.org/play/?id=nAUx1-VlrY4#cue@export@yaml) The output here is a product of _unifying_ the `#Person` _definition_ with an object that contains _concrete values_ each of which is the product of unifying the concrete value with the _types_ and _constraints_ declared by the field in the definition. [Try it in the CUE playground](https://cuelang.org/play/?id=nAUx1-VlrY4#cue@export@yaml)
### Default Values and the Nature of Inheritance ### Default Values and the Nature of Inheritance