-
Notifications
You must be signed in to change notification settings - Fork 0
Adding CSS to new domain #2
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
Closed
Closed
Changes from 19 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
73cf20d
add environment file
jukent 22c4adf
add preview.yml
jukent 27b224c
add cookbook_gallery.yml
jukent 142f35a
add extensions
jukent cec172f
add conf.py
jukent 0b0263c
add custom css and js
jukent ba51021
add footer templates
jukent a9b84f2
add yaml to environment
jukent f39511b
update yaml
jukent a8a3d7b
add ci.yml
jukent 6db5382
copy from cookbook template
jukent fa8a97a
copy code from portal
jukent 0e25ef9
update text to match new repo
jukent 0e6900c
move makefile to portal
jukent 941b1d0
rm jupyter book css
jukent cfaab61
fix logos
jukent 83bcce4
fix path
jukent c4992f0
set gallery generator page to index
jukent b6ac27f
fix image path
jukent f5f90e7
add ci
jukent da7cbd0
rename "portal" to "cookbooks"
jukent 6f1ff7a
fix codeowners to new team
jukent d3789e7
rm portal from ci
jukent 6ba51cf
rename from cookbooks to site
jukent b33f7b0
fix gitignore
jukent d8dbafa
rm site/_build
jukent b2a3c05
add nsf footer logo
jukent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# GLOBAL OWNER | ||
* @ProjectPythia/infrastructure | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: 2 | ||
updates: | ||
# - package-ecosystem: pip | ||
# directory: "/" | ||
# schedule: | ||
# interval: daily | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
schedule: | ||
# Check for updates once a week | ||
interval: 'weekly' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import json | ||
import os | ||
import typing | ||
|
||
import frontmatter | ||
import pydantic | ||
from markdown_it import MarkdownIt | ||
|
||
|
||
class Author(pydantic.BaseModel): | ||
name: str = 'anonymous' | ||
affiliation: str = None | ||
affiliation_url: typing.Union[str, pydantic.HttpUrl] = None | ||
email: typing.Union[str, pydantic.EmailStr] = None | ||
|
||
|
||
class Submission(pydantic.BaseModel): | ||
title: str | ||
description: str | ||
url: pydantic.HttpUrl | ||
thumbnail: typing.Union[str, pydantic.HttpUrl] = None | ||
authors: typing.List[Author] = None | ||
tags: typing.Dict[str, typing.List[str]] = None | ||
|
||
|
||
@pydantic.dataclasses.dataclass | ||
class IssueInfo: | ||
gh_event_path: pydantic.FilePath | ||
submission: Submission = pydantic.Field(default=None) | ||
|
||
def __post_init_post_parse__(self): | ||
with open(self.gh_event_path) as f: | ||
self.data = json.load(f) | ||
|
||
def create_submission(self): | ||
self._get_inputs() | ||
self._create_submission_input() | ||
return self | ||
|
||
def _get_inputs(self): | ||
self.author = self.data['issue']['user']['login'] | ||
self.title = self.data['issue']['title'] | ||
self.body = self.data['issue']['body'] | ||
|
||
def _create_submission_input(self): | ||
md = MarkdownIt() | ||
inputs = None | ||
for token in md.parse(self.body): | ||
if token.tag == 'code': | ||
inputs = frontmatter.loads(token.content).metadata | ||
break | ||
name = inputs.get('name') | ||
title = inputs.get('title') | ||
description = inputs.get('description') | ||
url = inputs.get('url') | ||
thumbnail = inputs.get('thumbnail') | ||
_authors = inputs.get('authors') | ||
authors = [] | ||
if _authors: | ||
for item in _authors: | ||
authors.append( | ||
Author( | ||
name=item.get('name', 'anyonymous'), | ||
affiliation=item.get('affiliation'), | ||
affiliation_url=item.get('affiliation_url'), | ||
email=item.get('email', ''), | ||
) | ||
) | ||
else: | ||
authors = [Author(name='anyonymous')] | ||
_tags = inputs.get( | ||
'tags', {'packages': ['unspecified'], 'formats': ['unspecified'], 'domains': ['unspecified']} | ||
) | ||
self.submission = Submission( | ||
name=name, title=title, description=description, url=url, thumbnail=thumbnail, authors=authors, tags=_tags | ||
) | ||
|
||
|
||
if __name__ == '__main__': | ||
|
||
issue = IssueInfo(gh_event_path=os.environ['GITHUB_EVENT_PATH']).create_submission() | ||
inputs = issue.submission.dict() | ||
with open('gallery-submission-input.json', 'w') as f: | ||
json.dump(inputs, f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
portal/_build/ | ||
jukent marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dist/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-docstring-first | ||
- id: check-json | ||
- id: check-yaml | ||
- id: double-quote-string-fixer | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
|
||
- repo: https://github.com/keewis/blackdoc | ||
rev: v0.3.4 | ||
hooks: | ||
- id: blackdoc | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 4.0.1 | ||
hooks: | ||
- id: flake8 | ||
|
||
- repo: https://github.com/asottile/seed-isort-config | ||
rev: v2.2.0 | ||
hooks: | ||
- id: seed-isort-config | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
|
||
# - repo: https://github.com/prettier/pre-commit | ||
# rev: 57f39166b5a5a504d6808b87ab98d41ebf095b46 | ||
# hooks: | ||
# - id: prettier | ||
|
||
- repo: https://github.com/nbQA-dev/nbQA | ||
rev: 1.3.1 | ||
hooks: | ||
- id: nbqa-black | ||
additional_dependencies: [black==20.8b1] | ||
- id: nbqa-pyupgrade | ||
additional_dependencies: [pyupgrade==2.7.3] | ||
# - id: nbqa-isort | ||
# additional_dependencies: [isort==5.6.4] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: pythia-tutorial-dev | ||
channels: | ||
- conda-forge | ||
- nodefaults | ||
dependencies: | ||
- matplotlib | ||
- myst-nb | ||
- pandas | ||
- pip | ||
- pyyaml | ||
- pre-commit | ||
- sphinx-panels | ||
- pip: | ||
- sphinx-pythia-theme |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
1 change: 1 addition & 0 deletions
1
portal/_build/html/_panels_static/panels-main.c949a650a448cc0ae9fd3441c0e17fb0.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
portal/_build/html/_panels_static/panels-variables.06eb56fa6e07937060861dad626602ad.css
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
:root { | ||
--tabs-color-label-active: hsla(231, 99%, 66%, 1); | ||
--tabs-color-label-inactive: rgba(178, 206, 245, 0.62); | ||
--tabs-color-overline: rgb(207, 236, 238); | ||
--tabs-color-underline: rgb(207, 236, 238); | ||
--tabs-size-label: 1rem; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import yaml | ||
from gallery_generator import build_from_items, generate_menu | ||
|
||
|
||
def main(app): | ||
|
||
with open('cookbook_gallery.yaml') as fid: | ||
all_items = yaml.safe_load(fid) | ||
|
||
title = 'Cookbooks Gallery' | ||
subtext = 'Pythia Cookbooks provide example workflows on more advanced and domain-specific problems developed by the Pythia community. Cookbooks build on top of skills you learn in Pythia Foundations.' | ||
menu_html = generate_menu(all_items) | ||
build_from_items(all_items, 'index', title=title, subtext=subtext, menu_html=menu_html) | ||
|
||
|
||
def setup(app): | ||
app.connect('builder-inited', main) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.