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

check the badge #10

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions .github/workflows/badges.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: RTD Preview
on:
pull_request_target:
types: [opened]

permissions:
pull-requests: write

jobs:
binder:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issue_number = context.issue.number;
const {repo, owner} = context.repo;
const body = `[![lite-badge](https://jupyak.rtfd.io/en/latest/_static/badge.svg)](https://jupyak--${issue_number}.org.readthedocs.build/en/${issue_number}) :point_left: Try it on ReadTheDocs`;
github.rest.issues.createComment({issue_number, owner, repo, body});
2 changes: 2 additions & 0 deletions docs/_static/img/badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""documentation for ``jupyak``."""
import datetime
import json
import os
import re
from pathlib import Path

Expand All @@ -24,6 +26,7 @@
for ext in ["toml", "yaml", "yml", "json"]
if (ROOT / f"jupyak_config.{ext}").exists()
]
ALLOW_NO_CONFIG = json.loads(os.environ.get("JUPYAK_ALLOW_NO_CONFIG", "0").lower())

# metadata
author = PROJ_DATA["project"]["authors"][0]["name"]
Expand Down Expand Up @@ -101,7 +104,7 @@
if REPO_INFO is not None:
html_context = {**REPO_INFO.groupdict(), "doc_path": "docs"}

if JUPYAK_CONF_CANDIDATES:
if ALLOW_NO_CONFIG or JUPYAK_CONF_CANDIDATES:
html_sidebars["*"] = [
"demo",
*html_sidebars["*"],
Expand Down