Skip to content

Commit 72e40e4

Browse files
docs: Set up docs site infra and refactor existing docs into the site. (#127)
Co-authored-by: Kirk Rodrigues <2454684+kirkrodrigues@users.noreply.github.com>
1 parent d07c1b7 commit 72e40e4

24 files changed

+756
-125
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
/node_modules
33

44
# Build
5+
/.task
6+
/build
57
/dist
68

79
# For bundle size analysis

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "tools/yscope-dev-utils"]
2+
path = tools/yscope-dev-utils
3+
url = https://github.com/y-scope/yscope-dev-utils.git

README.md

+26-57
Original file line numberDiff line numberDiff line change
@@ -4,83 +4,52 @@
44
![Open feature requests][feature-requests-shield]
55
![CLP on Zulip][zulip-shield]
66

7-
`yscope-log-viewer` is a tool that can be used to view log files. It currently
8-
supports [CLP][clp-repo]'s compressed log files (IR streams) and JSON log files.
9-
The viewer can be used to navigate the log file, filter by log level, view the
10-
logs with syntax highlighting, and generate direct links to specific log events.
7+
The YScope Log Viewer is a tool that can be used to view log files. It currently supports
8+
[CLP][clp-repo]'s compressed log files (IR streams) and JSON log files. The viewer can be used to
9+
navigate the log file, filter by log level, view the logs with syntax highlighting, and generate
10+
direct links to specific log events.
1111

12-
See the [online demo](#online-demo) section to try out the log viewer on a
13-
sample log file. To set up a local server, follow the
14-
[build guide](docs/dev-guide/building.md).
12+
See the [demo](#demo) section to try the log viewer on a sample log file. Or you can generate your
13+
own compressed log files using one of our [libraries][docs-site/generating-ir-stream-logs].
1514

16-
See the [features in development](#features-in-development) section for upcoming
17-
features.
15+
Want to report a bug or request a feature? Check out the [feedback](#providing-feedback) section.
16+
A list of [features in development][docs-site/features-in-development] is available on our
17+
[docs site][docs-site].
1818

19-
# Online Demo
19+
# Demo
20+
21+
A demo of the viewer available [here][online-demo].
2022

21-
* A demo of the log viewer can be found [here][online-demo].
2223
* The demo loads a Hadoop YARN log file from the [hive-24hrs] log dataset.
2324
* More info on the dataset and other datasets can be found [here][datasets].
24-
* To open an IR stream, drag and drop it onto the log viewer or use the open
25-
file dialog.
26-
27-
# Generating IR Stream Logs
28-
29-
IR stream log files can currently be generated using these libraries:
30-
31-
* [Log4j Logging Library][log4j1-appenders]
32-
* [Logback Logging Library][logback-appenders]
33-
* [Python Logging Library][clp-loglib-py]
34-
* Golang Logging Library (in development)
35-
36-
# How does it work?
25+
* To open an IR stream, drag and drop it onto the log viewer or use the open file dialog.
3726

38-
The log viewer is written using the ReactJS framework and uses the open source
39-
[monaco-editor] and [clp-ffi-js].
27+
# Docs
4028

41-
The viewer spawns a worker to assist with computationally intensive tasks such
42-
as:
29+
The log viewer's docs are available [here][docs-site].
4330

44-
* Deserializing the file and creating an index of logs events.
45-
* Paginating the indexed logs.
46-
* Decoding the deserialized log events into plain text.
31+
# Providing feedback
4732

48-
Tasks are passed to the worker as needed and changes are rendered in the UI.
49-
50-
# Providing Feedback
51-
52-
You can use GitHub issues to [report a bug][report-bug] or
53-
[request a feature][request-feature].
33+
You can use GitHub issues to [report a bug][bug-report] or [request a feature][feature-req].
5434

5535
Join us on [Zulip][zulip] to chat with developers and other community members.
5636

5737
# Contributing
5838

59-
See the docs in our [developer guide](docs/dev-guide).
60-
61-
# Features in Development
62-
63-
* Pretty printing to enhance the readability of structured data in the logs.
64-
* A dashboard to visualize the distribution of log types and log levels.
65-
* Support for plain text, archived log files, and other requested formats.
66-
* Searching within a file, multiple files, or within provided time ranges.
67-
* Infinite scrolling instead of pagination.
68-
* Log correlation with sync by timestamp across multiple editors.
69-
* Automatic conversion of text log files to IR stream format in the browser.
70-
* Deployment of components via NPM.
39+
See the docs in our [developer guide][docs-site/dev-guide].
7140

41+
[bug-report]: https://github.com/y-scope/yscope-log-viewer/issues/new?labels=bug&template=bug-report.yml
7242
[bugs-shield]: https://img.shields.io/github/issues/y-scope/yscope-log-viewer/bug?label=bugs
73-
[clp-ffi-js]: https://github.com/y-scope/clp-ffi-js
74-
[clp-loglib-py]: https://github.com/y-scope/clp-loglib-py
7543
[clp-repo]: https://github.com/y-scope/clp
7644
[datasets]: https://docs.yscope.com/clp/main/user-guide/resources-datasets
45+
[docs-site]: https://docs.yscope.com/yscope-log-viewer/main/
46+
[docs-site/building]: https://docs.yscope.com/yscope-log-viewer/main/dev-guide/building-getting-started
47+
[docs-site/dev-guide]: https://docs.yscope.com/yscope-log-viewer/main/dev-guide/index
48+
[docs-site/features-in-development]: https://docs.yscope.com/yscope-log-viewer/main/index#features-in-development
49+
[docs-site/generating-ir-stream-logs]: https://docs.yscope.com/yscope-log-viewer/main/index#generating-ir-stream-logs
50+
[feature-req]: https://github.com/y-scope/yscope-log-viewer/issues/new?labels=enhancement&template=feature-request.yml
7751
[feature-requests-shield]: https://img.shields.io/github/issues/y-scope/yscope-log-viewer/enhancement?label=feature-requests
78-
[hive-24hrs]: https://zenodo.org/record/7094921#.Y5JbH33MKHs
79-
[log4j1-appenders]: https://github.com/y-scope/log4j1-appenders
80-
[logback-appenders]: https://github.com/y-scope/logback-appenders
81-
[monaco-editor]: https://microsoft.github.io/monaco-editor/
52+
[hive-24hrs]: https://zenodo.org/records/7094921#.Y5JbH33MKHs
8253
[online-demo]: https://y-scope.github.io/yscope-log-viewer/?filePath=https://yscope.s3.us-east-2.amazonaws.com/sample-logs/yarn-ubuntu-resourcemanager-ip-172-31-17-135.log.1.clp.zst
83-
[report-bug]: https://github.com/y-scope/yscope-log-viewer/issues/new?labels=bug&template=bug-report.yml
84-
[request-feature]: https://github.com/y-scope/yscope-log-viewer/issues/new?labels=enhancement&template=feature-request.yml
8554
[zulip]: https://yscope-clp.zulipchat.com/
8655
[zulip-shield]: https://img.shields.io/badge/zulip-yscope--clp%20chat-1888FA?logo=zulip

docs/README.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Docs
2+
3+
This directory contains the files necessary to generate a Sphinx-based documentation website for
4+
this project:
5+
6+
* `conf` - Configuration files
7+
* `src` - The actual docs
8+
9+
## Requirements
10+
11+
* [Git LFS][git-lfs]
12+
* We use Git LFS to store the images in the docs; this is to avoid significant increases in
13+
the size of repo as we add and update images.
14+
* [Node.js] >= 16 to be able to [view the output](#viewing-the-output)
15+
* Python 3.10 or later
16+
* [Task] >= 3.38.0
17+
18+
## Build commands
19+
20+
* Build the site incrementally:
21+
22+
```shell
23+
task docs:site
24+
```
25+
26+
* The output of the build will be in `../build/docs/html`.
27+
28+
* Clean up the build:
29+
30+
```shell
31+
task docs:clean
32+
```
33+
34+
## Viewing the output
35+
36+
```shell
37+
task docs:serve
38+
```
39+
40+
The command above will install [http-server] and serve the built docs site; `http-server` will print
41+
the address it binds to (usually http://localhost:8080).
42+
43+
[git-lfs]: https://git-lfs.com
44+
[http-server]: https://www.npmjs.com/package/http-server
45+
[Node.js]: https://nodejs.org/en/download/current
46+
[Task]: https://taskfile.dev/

docs/conf/conf.py

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# -- Project information -------------------------------------------------------
2+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
3+
4+
project = "YScope Log Viewer"
5+
6+
# NOTE: We don't include a period after "Inc" since the theme adds one already.
7+
copyright = "2022-2024 YScope Inc"
8+
9+
# -- General configuration -----------------------------------------------------
10+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
11+
12+
extensions = [
13+
"myst_parser",
14+
"sphinx_copybutton",
15+
"sphinx_design",
16+
"sphinx.ext.autodoc",
17+
"sphinx.ext.viewcode",
18+
"sphinxcontrib.mermaid",
19+
]
20+
21+
# -- MyST extensions -----------------------------------------------------------
22+
# https://myst-parser.readthedocs.io/en/stable/syntax/optional.html
23+
myst_enable_extensions = [
24+
"attrs_block",
25+
"colon_fence",
26+
]
27+
28+
myst_heading_anchors = 4
29+
30+
# -- Sphinx autodoc options ----------------------------------------------------
31+
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#configuration
32+
33+
autoclass_content = "class"
34+
autodoc_class_signature = "separated"
35+
autodoc_typehints = "description"
36+
37+
# -- HTML output options -------------------------------------------------------
38+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
39+
40+
html_favicon = "https://docs.yscope.com/_static/favicon.ico"
41+
html_title = project
42+
html_show_copyright = True
43+
44+
html_static_path = ["../src/_static"]
45+
46+
html_theme = "pydata_sphinx_theme"
47+
48+
# -- Theme options -------------------------------------------------------------
49+
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html
50+
51+
html_theme_options = {
52+
"footer_start": ["copyright"],
53+
"footer_center": [],
54+
"footer_end": ["theme-version"],
55+
"navbar_start": ["navbar-logo"],
56+
"navbar_end": ["navbar-icon-links", "theme-switcher"],
57+
"primary_sidebar_end": [],
58+
"secondary_sidebar_items": ["page-toc", "edit-this-page"],
59+
"show_prev_next": False,
60+
"use_edit_page_button": True,
61+
}
62+
63+
# -- Theme source buttons ------------------------------------------------------
64+
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/source-buttons.html
65+
66+
html_context = {
67+
"github_user": "y-scope",
68+
"github_repo": "yscope-log-viewer",
69+
"github_version": "main",
70+
"doc_path": "docs/src",
71+
}
72+
73+
# -- Theme custom CSS and JS ---------------------------------------------------
74+
# https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/static_assets.html
75+
76+
77+
def setup(app):
78+
app.add_css_file("custom.css")

docs/dev-guide/building.md

-30
This file was deleted.

docs/dev-guide/state-and-stateRef.md

-6
This file was deleted.

docs/dev-guide/validation.md

-16
This file was deleted.

docs/dev-guide/var-naming.md

-16
This file was deleted.

docs/requirements.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
myst-parser>=4.0.0
2+
pydata-sphinx-theme>=0.16.0
3+
sphinx_design>=0.6.1
4+
sphinx-copybutton>=0.5.2
5+
sphinx>=8.1.3
6+
sphinxcontrib-mermaid>=1.0.0

docs/src/_static/custom.css

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
html[data-theme="dark"], html[data-theme="light"] {
2+
--pst-color-primary: #3399ff;
3+
--pst-color-secondary: #9580ff;
4+
}
5+
6+
a {
7+
text-decoration: none;
8+
}
9+
10+
a:hover {
11+
text-decoration: underline;
12+
}
13+
14+
/*
15+
Use the bottom border that's used for indicating the current page as the hover style (for a more
16+
cohesive look).
17+
NOTE: This selector matches the one in pydata-sphinx-theme
18+
pydata/pydata-sphinx-theme@v0.14.4/src/pydata_sphinx_theme/assets/styles/sections/_header.scss#L86
19+
*/
20+
.bd-header .navbar-nav li a.nav-link:hover {
21+
border-bottom: max(3px,.1875rem,.12em) solid var(--pst-color-secondary);
22+
text-decoration: none;
23+
}
24+
25+
/*
26+
Remove margin from sidebar-primary-items__end so that we don't have an unnecessary scrollbar. We're
27+
not using the end items currently.
28+
*/
29+
.bd-sidebar-primary .sidebar-primary-items__end {
30+
margin-top: 0;
31+
margin-bottom: 0;
32+
}

0 commit comments

Comments
 (0)