Skip to content

Commit

Permalink
For internal docs, omit the intro sections
Browse files Browse the repository at this point in the history
Summary:
The intro sections are primarily aimed at open-source users and don't
make much sense for internal users, so let's just omit them from the
internal docs.

Differential Revision: D68629651

fbshipit-source-id: fd96ee5f890ff18f06df3c255694afa2e8fbbae5
  • Loading branch information
Simon Marlow authored and facebook-github-bot committed Jan 27, 2025
1 parent 327bbf8 commit db6b2f6
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 11 deletions.
15 changes: 15 additions & 0 deletions glean/website/docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ sidebar_label: Introduction
import {OssOnly, FbInternalOnly} from 'internaldocs-fb-helpers';
import {SrcFile,SrcFileLink} from '@site/utils';

<FbInternalOnly>

This is the Glean documentation. It describes all aspects of the
system, including how to write queries and schemas, and how
to use the included command-line tools. Use the navigation on the left
to find all the sections.

If you found yourself here by mistake, go back to the
main [Glean Wiki](https://www.internalfb.com/wiki/Glean/).


</FbInternalOnly>

## Overview

Glean is a system for working with facts about source code. It is
designed for collecting and storing detailed information about code
structure, and providing access to the data to power tools and
Expand Down
29 changes: 26 additions & 3 deletions glean/website/docs/walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,26 @@ sidebar_label: Walkthrough

import {OssOnly, FbInternalOnly} from 'internaldocs-fb-helpers';

<OssOnly>

We can play with Glean using the [shell](shell.md). You can do this
directly from the [Docker image](trying.md) if you want, or [Build Glean
from source](./building.md) first.

</OssOnly>

<FbInternalOnly>

We can play with Glean using the [shell](shell.md).

</FbInternalOnly>

To try experiments we can work with a local schema definition and
local database (as opposed to connecting to a Glean server). If you
want to play along with the examples, you can do so as follows:

<OssOnly>

```lang=sh
mkdir /tmp/glean
mkdir /tmp/glean/db
Expand All @@ -28,10 +40,21 @@ data](https://github.com/facebookincubator/Glean/blob/master/glean/example/facts
in `/tmp/glean/facts.glean`. Then reload schema and create a database from the example
data using `:reload` and `:load <file>` in the shell:

</OssOnly>

<FbInternalOnly>

```lang=sh
cd fbcode
glean shell --db-root /tmp/glean --schema glean/example/schema
```

Then create a database from the example data with `:load <file>` in the shell:

</FbInternalOnly>

```lang=sh
> :reload
reloading schema [2 schemas, 7 predicates]
> :load /tmp/glean/facts.glean
> :load glean/example/facts.glean
facts>
```

Expand Down
24 changes: 16 additions & 8 deletions glean/website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@
const {fbContent, fbInternalOnly} = require('internaldocs-fb-helpers');

module.exports = {
someSidebar: {
'Quick Start': [
'introduction',
'trying',
'building',
'walkthrough',
],
someSidebar: [
'introduction',
...fbContent({
internal: [
'walkthrough',
],
external: [{
'Quick Start': [
'trying',
'building',
'walkthrough',
]
}],
}),
{
'User Guide': [
{
'Schemas': [
Expand Down Expand Up @@ -94,4 +102,4 @@ module.exports = {
},
],
},
};
]};

0 comments on commit db6b2f6

Please sign in to comment.