From 6cff69796388823d510f2abaf190c2f22ac48576 Mon Sep 17 00:00:00 2001
From: Florent FAYOLLE
+{% endfor -%}
+{%- for sponsor in sponsors.silver -%}
+
+{% endfor %}
+{% endif %}
+"""
+
+
+def generate_readme_content() -> str:
+ en_index = en_docs_path / "docs" / "index.md"
+ content = en_index.read_text("utf-8")
+ match_pre = re.search(r"\n\n", content)
+ match_start = re.search(r"", content)
+ match_end = re.search(r"", content)
+ sponsors_data_path = en_docs_path / "data" / "sponsors.yml"
+ sponsors = mkdocs.utils.yaml_load(sponsors_data_path.read_text(encoding="utf-8"))
+ if not (match_start and match_end):
+ raise RuntimeError("Couldn't auto-generate sponsors section")
+ if not match_pre:
+ raise RuntimeError("Couldn't find pre section (\n\n", content)
match_start = re.search(r"", content)
@@ -267,17 +274,17 @@ def live(
def get_updated_config_content() -> Dict[str, Any]:
- config = get_en_config()
+ config = get_base_config_path()
languages = [{"en": "/"}]
new_alternate: List[Dict[str, str]] = []
# Language names sourced from https://quickref.me/iso-639-1
# Contributors may wish to update or change these, e.g. to fix capitalization.
- language_names_path = Path(__file__).parent / "../docs/language_names.yml"
+ language_names_path = Path(__file__).parent / docs_folder_name / "language_names.yml"
local_language_names: Dict[str, str] = mkdocs.utils.yaml_load(
language_names_path.read_text(encoding="utf-8")
)
for lang_path in get_lang_paths():
- if lang_path.name in {"en", "em"} or not lang_path.is_dir():
+ if lang_path.name == "en" or not lang_path.is_dir():
continue
code = lang_path.name
languages.append({code: f"/{code}/"})
@@ -287,19 +294,18 @@ def get_updated_config_content() -> Dict[str, Any]:
if code not in local_language_names:
print(
f"Missing language name for: {code}, "
- "update it in docs/language_names.yml"
+ f"update it in {docs_folder_name}/language_names.yml"
)
raise typer.Abort()
use_name = f"{code} - {local_language_names[code]}"
new_alternate.append({"link": url, "name": use_name})
- new_alternate.append({"link": "/em/", "name": "😉"})
config["extra"]["alternate"] = new_alternate
return config
def update_config() -> None:
config = get_updated_config_content()
- en_config_path.write_text(
+ base_config_path.write_text(
yaml.dump(config, sort_keys=False, width=200, allow_unicode=True),
encoding="utf-8",
)
@@ -311,13 +317,13 @@ def verify_config() -> None:
Verify main mkdocs.yml content to make sure it uses the latest language names.
"""
typer.echo("Verifying mkdocs.yml")
- config = get_en_config()
+ config = get_base_config_path()
updated_config = get_updated_config_content()
if config != updated_config:
typer.secho(
- "docs/en/mkdocs.yml outdated from docs/language_names.yml, "
+ f"{docs_folder_name}/en/mkdocs.yml outdated from {docs_folder_name}/language_names.yml, "
"update language_names.yml and run "
- "python ./scripts/docs.py update-languages",
+ "python ./docs.py update-languages",
color=typer.colors.RED,
)
raise typer.Abort()
diff --git a/help/language_names.yml b/help/language_names.yml
new file mode 100644
index 000000000..b461eae69
--- /dev/null
+++ b/help/language_names.yml
@@ -0,0 +1,2 @@
+en: English
+fr: français
diff --git a/mkdocs.yml b/mkdocs.yml
index 58113f0a3..faf28384d 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -1,204 +1,197 @@
site_name: Grist Help Center
site_dir: site
-site_description: "Tutorials and resources for Grist, to help you organize your data, your way."
-site_url: "https://support.getgrist.com"
-repo_name: "GitHub"
-repo_url: "https://github.com/gristlabs/grist-help"
-
-# use directory urls (for prettiness) unless running htmlproofing
-# (which is confused by them).
-use_directory_urls: !ENV [HTMLPROOFER_OVERRIDE_USE_DIRECTORY_URLS, true]
-
-docs_dir: './help/en/docs' # Add localization folder here for now, we'll handle i18n later
-# windmill is a theme maintained by Grist Labs in https://github.com/gristlabs/mkdocs-windmill
+site_description: Tutorials and resources for Grist, to help you organize your data, your way.
+site_url: https://support.getgrist.com
+repo_name: GitHub
+repo_url: https://github.com/gristlabs/grist-help
+use_directory_urls: true
+docs_dir: ./help/en/docs
theme:
name: windmill
custom_dir: overrides
nav:
- - Welcome to Grist: index.md
- - FAQ: FAQ.md
- - How-To Tutorials:
- - Create your own CRM: lightweight-crm.md
- - Analyze and visualize: investment-research.md
- - Manage business data: afterschool-program.md
- - Managing documents:
- - Creating a document: creating-doc.md
- - Sharing a document: sharing.md
- - Copying documents: copying-docs.md
- - Importing more data: imports.md
- - Exports & backups: exports.md
- - Automatic backups: automatic-backups.md
- - Document history: document-history.md
- - Workspaces: workspaces.md
- - Pages and Tables:
- - Entering data: enter-data.md
- - Pages & widgets: page-widgets.md
- - Raw data page: raw-data.md
- - Search, sort & filter: search-sort-filter.md
- - Table widget: widget-table.md
- - Card & Card List: widget-card.md
- - Form: widget-form.md
- - Chart: widget-chart.md
- - Calendar: widget-calendar.md
- - Custom: widget-custom.md
- - Linking widgets: linking-widgets.md
- - Custom layouts: custom-layouts.md
- - Record Cards: record-cards.md
- - Summary tables: summary-tables.md
- - On-Demand tables: on-demand-tables.md
- - Columns and data types:
- - Columns & types: col-types.md
- - Reference columns: col-refs.md
- - Conditional Formatting: conditional-formatting.md
- - Timestamp columns: timestamps.md
- - Authorship columns: authorship.md
- - Transformations: col-transform.md
- - Using formulas:
- - Intro to formulas: formulas.md
- - References and Lookups: references-lookups.md
- - Working with dates: dates.md
- - Python versions: python.md
- - Function reference: functions.md
- - Formula Cheat Sheet: formula-cheat-sheet.md
- - AI Assistant:
- - AI Assistant: ai-assistant.md
- - Team Sites:
- - Creating team sites: teams.md
- - Sharing team sites: team-sharing.md
- - Access rules:
- - Intro to access rules: access-rules.md
- - Integrations:
- - REST API usage: rest-api.md
- - REST API reference: api.md
- - Integrator Services: integrators.md
- - Embedding: embedding.md
- - Plugin API:
- - Intro to Plugin API: code/README.md
- - grist-plugin-api: code/modules/grist_plugin_api.md
- - ... | flat | **/code/interfaces/**
- - ... | flat | **/code/modules/**
- - Self-Managed:
- - Self-managed Grist: self-managed.md
- - SAML: install/saml.md
- - OIDC: install/oidc.md
- - Forwarded headers: install/forwarded-headers.md
- - Cloud storage: install/cloud-storage.md
- - GristConnect: install/grist-connect.md
- - AWS Marketplace: install/aws-marketplace.md
- - Telemetry:
- - Overview of Telemetry: telemetry.md
- - Limited Telemetry: telemetry-limited.md
- - Full Telemetry: telemetry-full.md
- - News & updates:
- - Newsletters: newsletters.md
- - 2024/01: newsletters/2024-01.md
- - 2023/12: newsletters/2023-12.md
- - 2023/11: newsletters/2023-11.md
- - 2023/10: newsletters/2023-10.md
- - 2023/09: newsletters/2023-09.md
- - 2023/08: newsletters/2023-08.md
- - 2023/07: newsletters/2023-07.md
- - 2023/06: newsletters/2023-06.md
- - 2023/05: newsletters/2023-05.md
- - 2023/04: newsletters/2023-04.md
- - 2023/03: newsletters/2023-03.md
- - 2023/02: newsletters/2023-02.md
- - 2023/01: newsletters/2023-01.md
- - 2022/12: newsletters/2022-12.md
- - 2022/11: newsletters/2022-11.md
- - 2022/10: newsletters/2022-10.md
- - 2022/09: newsletters/2022-09.md
- - 2022/08: newsletters/2022-08.md
- - 2022/07: newsletters/2022-07.md
- - 2022/06: newsletters/2022-06.md
- - 2022/05: newsletters/2022-05.md
- - 2022/04: newsletters/2022-04.md
- - 2022/03: newsletters/2022-03.md
- - 2022/02: newsletters/2022-02.md
- - 2022/01: newsletters/2022-01.md
- - 2021/12: newsletters/2021-12.md
- - 2021/11: newsletters/2021-11.md
- - 2021/10: newsletters/2021-10.md
- - 2021/09: newsletters/2021-09.md
- - 2021/08: newsletters/2021-08.md
- - 2021/07: newsletters/2021-07.md
- - 2021/06: newsletters/2021-06.md
- - 2021/05: newsletters/2021-05.md
- - 2021/04: newsletters/2021-04.md
- - 2021/03: newsletters/2021-03.md
- - 2021/02: newsletters/2021-02.md
- - 2021/01: newsletters/2021-01.md
- - 2020/12: newsletters/2020-12.md
- - 2020/11: newsletters/2020-11.md
- - 2020/10: newsletters/2020-10.md
- - 2020/09: newsletters/2020-09.md
- - 2020/08: newsletters/2020-08.md
- - 2020/07: newsletters/2020-07.md
- - 2020/06: newsletters/2020-06.md
- - 2020/05: newsletters/2020-05.md
- - More examples:
- - More examples: examples.md
- - Credit card expenses: examples/2020-06-credit-card.md
- - Book club links: examples/2020-06-book-club.md
- - Prefill emails: examples/2020-07-email-compose.md
- - Prepare Invoices: examples/2020-08-invoices.md
- - Track Payroll: examples/2020-09-payroll.md
- - Print mailing labels: examples/2020-10-print-labels.md
- - Treasure Hunt: examples/2020-11-treasure-hunt.md
- - Map: examples/2020-12-map.md
- - Task Management: examples/2021-01-tasks.md
- - Lead List: examples/2021-03-leads.md
- - Link Keys Guide: examples/2021-04-link-keys.md
- - Reference Columns Guide: examples/2021-05-reference-columns.md
- - Summary Tables Guide: examples/2021-06-timesheets.md
- - Time and User Stamps: examples/2021-07-auto-stamps.md
- - Restrict Duplicate Records: examples/2023-01-acl-memo.md
- - Proposals & Contracts: examples/2023-07-proposals-contracts.md
- - Reference:
- - Shortcuts: keyboard-shortcuts.md
- # The function reference (functions.md) is listed above; here is an intentionally non-standard
- # link, so that only the above page item gets highlighted when the function reference is open.
- - Function reference: /functions/
- - Limits: limits.md
- - Data Security: data-security.md
- - Browser Support: browser-support.md
- - Glossary: glossary.md
-
+- Welcome to Grist: index.md
+- FAQ: FAQ.md
+- How-To Tutorials:
+ - Create your own CRM: lightweight-crm.md
+ - Analyze and visualize: investment-research.md
+ - Manage business data: afterschool-program.md
+- Managing documents:
+ - Creating a document: creating-doc.md
+ - Sharing a document: sharing.md
+ - Copying documents: copying-docs.md
+ - Importing more data: imports.md
+ - Exports & backups: exports.md
+ - Automatic backups: automatic-backups.md
+ - Document history: document-history.md
+ - Workspaces: workspaces.md
+- Pages and Tables:
+ - Entering data: enter-data.md
+ - Pages & widgets: page-widgets.md
+ - Raw data page: raw-data.md
+ - Search, sort & filter: search-sort-filter.md
+ - Table widget: widget-table.md
+ - Card & Card List: widget-card.md
+ - Form: widget-form.md
+ - Chart: widget-chart.md
+ - Calendar: widget-calendar.md
+ - Custom: widget-custom.md
+ - Linking widgets: linking-widgets.md
+ - Custom layouts: custom-layouts.md
+ - Record Cards: record-cards.md
+ - Summary tables: summary-tables.md
+ - On-Demand tables: on-demand-tables.md
+- Columns and data types:
+ - Columns & types: col-types.md
+ - Reference columns: col-refs.md
+ - Conditional Formatting: conditional-formatting.md
+ - Timestamp columns: timestamps.md
+ - Authorship columns: authorship.md
+ - Transformations: col-transform.md
+- Using formulas:
+ - Intro to formulas: formulas.md
+ - References and Lookups: references-lookups.md
+ - Working with dates: dates.md
+ - Python versions: python.md
+ - Function reference: functions.md
+ - Formula Cheat Sheet: formula-cheat-sheet.md
+- AI Assistant:
+ - AI Assistant: ai-assistant.md
+- Team Sites:
+ - Creating team sites: teams.md
+ - Sharing team sites: team-sharing.md
+- Access rules:
+ - Intro to access rules: access-rules.md
+- Integrations:
+ - REST API usage: rest-api.md
+ - REST API reference: api.md
+ - Integrator Services: integrators.md
+ - Embedding: embedding.md
+ - Plugin API:
+ - Intro to Plugin API: code/README.md
+ - grist-plugin-api: code/modules/grist_plugin_api.md
+ - '... | flat | **/code/interfaces/**'
+ - '... | flat | **/code/modules/**'
+- Self-Managed:
+ - Self-managed Grist: self-managed.md
+ - SAML: install/saml.md
+ - OIDC: install/oidc.md
+ - Forwarded headers: install/forwarded-headers.md
+ - Cloud storage: install/cloud-storage.md
+ - GristConnect: install/grist-connect.md
+ - AWS Marketplace: install/aws-marketplace.md
+ - Telemetry:
+ - Overview of Telemetry: telemetry.md
+ - Limited Telemetry: telemetry-limited.md
+ - Full Telemetry: telemetry-full.md
+- News & updates:
+ - Newsletters: newsletters.md
+ - 2024/01: newsletters/2024-01.md
+ - 2023/12: newsletters/2023-12.md
+ - 2023/11: newsletters/2023-11.md
+ - 2023/10: newsletters/2023-10.md
+ - 2023/09: newsletters/2023-09.md
+ - 2023/08: newsletters/2023-08.md
+ - 2023/07: newsletters/2023-07.md
+ - 2023/06: newsletters/2023-06.md
+ - 2023/05: newsletters/2023-05.md
+ - 2023/04: newsletters/2023-04.md
+ - 2023/03: newsletters/2023-03.md
+ - 2023/02: newsletters/2023-02.md
+ - 2023/01: newsletters/2023-01.md
+ - 2022/12: newsletters/2022-12.md
+ - 2022/11: newsletters/2022-11.md
+ - 2022/10: newsletters/2022-10.md
+ - 2022/09: newsletters/2022-09.md
+ - 2022/08: newsletters/2022-08.md
+ - 2022/07: newsletters/2022-07.md
+ - 2022/06: newsletters/2022-06.md
+ - 2022/05: newsletters/2022-05.md
+ - 2022/04: newsletters/2022-04.md
+ - 2022/03: newsletters/2022-03.md
+ - 2022/02: newsletters/2022-02.md
+ - 2022/01: newsletters/2022-01.md
+ - 2021/12: newsletters/2021-12.md
+ - 2021/11: newsletters/2021-11.md
+ - 2021/10: newsletters/2021-10.md
+ - 2021/09: newsletters/2021-09.md
+ - 2021/08: newsletters/2021-08.md
+ - 2021/07: newsletters/2021-07.md
+ - 2021/06: newsletters/2021-06.md
+ - 2021/05: newsletters/2021-05.md
+ - 2021/04: newsletters/2021-04.md
+ - 2021/03: newsletters/2021-03.md
+ - 2021/02: newsletters/2021-02.md
+ - 2021/01: newsletters/2021-01.md
+ - 2020/12: newsletters/2020-12.md
+ - 2020/11: newsletters/2020-11.md
+ - 2020/10: newsletters/2020-10.md
+ - 2020/09: newsletters/2020-09.md
+ - 2020/08: newsletters/2020-08.md
+ - 2020/07: newsletters/2020-07.md
+ - 2020/06: newsletters/2020-06.md
+ - 2020/05: newsletters/2020-05.md
+- More examples:
+ - More examples: examples.md
+ - Credit card expenses: examples/2020-06-credit-card.md
+ - Book club links: examples/2020-06-book-club.md
+ - Prefill emails: examples/2020-07-email-compose.md
+ - Prepare Invoices: examples/2020-08-invoices.md
+ - Track Payroll: examples/2020-09-payroll.md
+ - Print mailing labels: examples/2020-10-print-labels.md
+ - Treasure Hunt: examples/2020-11-treasure-hunt.md
+ - Map: examples/2020-12-map.md
+ - Task Management: examples/2021-01-tasks.md
+ - Lead List: examples/2021-03-leads.md
+ - Link Keys Guide: examples/2021-04-link-keys.md
+ - Reference Columns Guide: examples/2021-05-reference-columns.md
+ - Summary Tables Guide: examples/2021-06-timesheets.md
+ - Time and User Stamps: examples/2021-07-auto-stamps.md
+ - Restrict Duplicate Records: examples/2023-01-acl-memo.md
+ - Proposals & Contracts: examples/2023-07-proposals-contracts.md
+- Reference:
+ - Shortcuts: keyboard-shortcuts.md
+ - Function reference: functions.md
+ - Limits: limits.md
+ - Data Security: data-security.md
+ - Browser Support: browser-support.md
+ - Glossary: glossary.md
extra:
- logo: 'images/logo.png'
+ logo: images/logo.png
palette:
- primary: 'blue grey'
- accent: 'orange'
+ primary: blue grey
+ accent: orange
font:
- text: 'Roboto'
- code: 'Roboto Mono'
- homepage: '/help'
- version: '1.0.2-dev'
+ text: Roboto
+ code: Roboto Mono
+ homepage: /help
+ version: 1.0.2-dev
article_nav_bottom: false
history_buttons: false
home_links:
- - href: https://community.getgrist.com
- text: 'Community'
- - href: https://www.getgrist.com
- text: 'Back to Grist'
- hide_on_small_screen: true
- google_tag_manager: 'GTM-5FDHKQ9'
+ - href: https://community.getgrist.com
+ text: Community
+ - href: https://www.getgrist.com
+ text: Back to Grist
+ hide_on_small_screen: true
+ google_tag_manager: GTM-5FDHKQ9
+ alternate:
+ - link: /
+ name: en - English
extra_css:
- - css/grist.css
+- css/grist.css
extra_javascript:
- - js/grist.js
-
+- js/grist.js
plugins:
- - search
- - awesome-pages
- - htmlproofer:
- enabled: !ENV [HTMLPROOFER_ENABLED, false]
- validate_external_urls: false
- - meta-descriptions
-
+- search
+- awesome-pages
+- htmlproofer:
+ enabled: false
+ validate_external_urls: false
+- meta-descriptions
markdown_extensions:
toc:
- permalink: '#'
+ permalink: '#'
admonition: {}
smarty: {}
extra: {}
diff --git a/requirements.txt b/requirements.txt
index d98953148..5311b906e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -6,8 +6,8 @@ joblib==0.16.0
livereload==2.6.2
lunr==0.5.8
Markdown==3.2.2
-MarkupSafe==1.1.1
-mkdocs==1.2.3
+MarkupSafe==2.0.1
+mkdocs==1.5.3
mkdocs-awesome-pages-plugin==2.7.0
mkdocs-htmlproofer-plugin==0.8.0
mkdocs-meta-descriptions-plugin==2.0.0
@@ -19,3 +19,4 @@ requests==2.26.0
six==1.15.0
tornado==6.0.4
tqdm==4.48.0
+typer >=0.6.1,<0.8.0
From 6d2a138f4d4a11cba91d87b3e9743187322fd294 Mon Sep 17 00:00:00 2001
From: Florent FAYOLLE
{- "sql": "select * from Pets where popularity >= ?",
- "args": [
- 50
], - "timeout": 500
}
{- "statement": "select * from Pets ...",
- "records": [
- {
- "fields": {
- "id": 1,
- "pet": "cat",
- "popularity": 67
}
}, - {
- "fields": {
- "id": 2,
- "pet": "dog",
- "popularity": 95
}
}
]
}