Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docsify #1

Merged
merged 23 commits into from
Apr 13, 2024
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
prepare docsity files
lalalabox committed Nov 18, 2023
commit 1b53fcac29f7b6513c9415c8de282b999579ca70
38 changes: 38 additions & 0 deletions convert_to_docsify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
################### convert_to_docsify.sh ###################
# This script is used to convert the original markdown files
# to docsify markdown files.
#############################################################
set -e

# Check if the script is running inside a Git repository
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
echo "This script must be run inside a Git repository!!!"
exit 1
fi

source_file="docs/index.md"
target_file="docs/README.md"

# Check if source file exists
if [ ! -f "$source_file" ]; then
echo "source file $source_file does not exist"
else
# Rename file
mv "$source_file" "$target_file"
fi

# Delete start part of the file using awk
find . -type f -name "*.md" -exec awk '/^---$/ { p = !p; next } !p' {} > {}.tmp && mv {}.tmp {} \;

# # Convert images path using sed
# find . -type f -name "*.md" -exec sed -i 's|\.\./images/\(.*\.png\)|./images/\1|g' {} +

# Build Docker image of docsify
if [ -d "docs" ] && [ "$(id -u)" = "0" ]; then
cd docs
docker build -f Dockerfile -t docsify/demo .
docker restart docsify
else
echo "docs directory does not exist or you are not root"
fi
6 changes: 6 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:latest
LABEL description="A demo Dockerfile for build Docsify."
WORKDIR /docs
RUN npm install -g docsify-cli@latest
EXPOSE 3000/tcp
ENTRYPOINT docsify serve .
4 changes: 4 additions & 0 deletions docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<img src="images/logo_DOA_large.png" width="600">

[GitHub](https://github.com/gravity-doc/gravity-doc.github.io)
[Get started](/README.md)
3 changes: 3 additions & 0 deletions docs/_navbar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- [Cheatsheet](/QuickStart?id=cheatsheet-📜)
- [Gravity Homepage](https://jupyter.gravity.sjtu.edu.cn/)
- [Department of Astronomy (SJTU)](http://astro.sjtu.edu.cn/)
31 changes: 31 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
- [Quick start](/QuickStart.md)

- Basic

- [Account](/Basic/Account.md)
- [Login](/Basic/Login.md)
- [Job](/Basic/Job.md)
- [Quota usage](/Basic/Resource_Monitor.md)
- [Data transfer](/Basic/Data_Transfer.md)
- [Coding](/Basic/Coding.md)

- Advanced

- [X11 tunnel](/Advanced/X11_Tunnel.md)
- [VNC](/Advanced/VNC.md)
- [Jupyter](/Advanced/jupyter_notebook.md)
- [Status/Statistics website](/Advanced/status_website.md)
- [Globus](/Advanced/Globus.md)
- [Gitlab](/Advanced/Gitlab.md)

- Tools

- [Load installed module](/Software/Software_Installed.md)
- [Custom installation](/Software/User_Software_Installation.md)
- [Proxy](/Software/Proxy.md)

- [FAQ](/MISC/FAQ.md)
- [Issues](/MISC/Issues.md)
- [Cluster info](/About.md)
- [Policy](/Policy.md)
- [Changelog](/Updates.md)
69 changes: 69 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Gravity Documentation</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify/themes/vue.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css">
<!-- <link rel="stylesheet" href="https://unpkg.com/docsify-toc@1.0.0/dist/toc.css"> -->
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
auto2top: true,
// basePath: '/docs/',
// relativePath: true,
coverpage: true,
executeScript: true,
loadSidebar: true,
loadNavbar: true,
mergeNavbar: true,
maxLevel: 4,
subMaxLevel: 2,
name: 'Gravity Documentation',
repo: 'https://github.com/gravity-doc/gravity-doc.github.io/',
logo: './images/logo_DOA_mini.png',
search: {
paths: 'auto',
placeholder: 'Search / 搜索关键词',
noData: 'No results / 无结果 ╥﹏╥...',
depth: 2
},
busuanzi: true,
count:{
countable:true,
fontsize:'0.9em',
color:'rgb(90,90,90)',
language:'chinese'
}
}

</script>
<!-- Docsify v4 -->
<script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
<script src="//unpkg.com/docsify-count/dist/countable.js"></script>
<script src="//cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/marked@4"></script>

<!-- latex -->
<script src="//cdn.jsdelivr.net/npm/docsify-katex@latest/dist/docsify-katex.js"></script>


<!-- 图像缩放 -->
<script src="//cdn.jsdelivr.net/npm/docsify/lib/plugins/zoom-image.min.js"></script>

<!-- 文档内页目录 -->
<!-- <script src="https://unpkg.com/docsify-toc@1.0.0/dist/toc.js"></script> -->

<!-- python 内联代码 -->
<script src="//cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-python.min.js"></script>

<!-- busuanzi统计 -->
<script src="https://unpkg.com/docsify-busuanzi@1.0.1/dist/docsify-busuanzi.min.js"></script>

</body>
</html>