diff --git a/.DS_Store b/.DS_Store index c4d538c..4b44498 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/LICENSE b/LICENSE index 99be2c8..1697c87 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 drizk1 and contributors +Copyright (c) 2024 Daniel Rizk and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Project.toml b/Project.toml index c64c678..afb5744 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "TidierDB" uuid = "86993f9b-bbba-4084-97c5-ee15961ad48b" -authors = ["drizk1 and contributors"] -version = "1.0.0-DEV" +authors = ["Daniel Rizk and contributors"] +version = "0.1.0-DEV" [deps] Chain = "8be319e6-bccf-4806-a6f7-6fae938471bc" diff --git a/docs/.DS_Store b/docs/.DS_Store new file mode 100644 index 0000000..052f2eb Binary files /dev/null and b/docs/.DS_Store differ diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 0000000..91a55e1 --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,10 @@ +[deps] +Chain = "8be319e6-bccf-4806-a6f7-6fae938471bc" +DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +DuckDB = "d2f5444f-75bc-4fdf-ac35-56f514c445e1" +LibPQ = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" +MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +Reexport = "189a3867-3050-52da-a836-e630ba90ab69" +SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9" +TidierDB = "86993f9b-bbba-4084-97c5-ee15961ad48b" diff --git a/docs/_overrides/.DS_Store b/docs/_overrides/.DS_Store new file mode 100644 index 0000000..d442f7f Binary files /dev/null and b/docs/_overrides/.DS_Store differ diff --git a/docs/_overrides/partials/source.html b/docs/_overrides/partials/source.html new file mode 100644 index 0000000..4130444 --- /dev/null +++ b/docs/_overrides/partials/source.html @@ -0,0 +1,30 @@ +{% import "partials/language.html" as lang with context %} + +
+ {% set icon = config.theme.icon.repo or "fontawesome/brands/git-alt" %} + {% include ".icons/" ~ icon ~ ".svg" %} +
+
+ {{ config.repo_name }} +
+
+{% if config.theme.twitter_url %} + +
+ {% include ".icons/fontawesome/brands/twitter.svg" %} +
+
+ {{ config.theme.twitter_name }} +
+
+{% endif %} +{% if config.theme.sponsor_url %} + +
+ {% include ".icons/fontawesome/regular/heart.svg" %} +
+
+ {{ config.theme.sponsor_name }} +
+
+{% endif %} \ No newline at end of file diff --git a/docs/examples/.DS_Store b/docs/examples/.DS_Store new file mode 100644 index 0000000..6afedeb Binary files /dev/null and b/docs/examples/.DS_Store differ diff --git a/docs/examples/UserGuide/key_differences.jl b/docs/examples/UserGuide/key_differences.jl new file mode 100644 index 0000000..e69de29 diff --git a/docs/genfiles.jl b/docs/genfiles.jl new file mode 100644 index 0000000..8f8925c --- /dev/null +++ b/docs/genfiles.jl @@ -0,0 +1,28 @@ +using Documenter, DocumenterMarkdown +using Literate + +get_example_path(p) = joinpath(@__DIR__, ".", "examples", p) +OUTPUT = joinpath(@__DIR__, "src", "examples", "generated") + +folders = readdir(joinpath(@__DIR__, ".", "examples")) +setdiff!(folders, [".DS_Store"]) + +function getfiles() + srcsfiles = [] + for f in folders + names = readdir(joinpath(@__DIR__, ".", "examples", f)) + setdiff!(names, [".DS_Store"]) + fpaths = "$(f)/" .* names + srcsfiles = vcat(srcsfiles, fpaths...) + end + return srcsfiles +end + +srcsfiles = getfiles() + +for (d, paths) in (("tutorial", srcsfiles),) + for p in paths + Literate.markdown(get_example_path(p), joinpath(OUTPUT, dirname(p)); + documenter=true) + end +end \ No newline at end of file diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 0000000..5832241 --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,34 @@ +using Documenter, DocumenterMarkdown +using Tidier, TidierDB + +DocTestMeta = quote + using Tidier, TidierDB, DataFrames, Chain +end +DocMeta.setdocmeta!(TidierDB, + :DocTestSetup, + DocTestMeta; + recursive=true) +makedocs( + modules=[TidierDB], + clean=true, + doctest=false, + #format = Documenter.HTML(prettyurls = get(ENV, "CI", nothing) == "true"), + sitename="TidierDB.jl", + authors="Karandeep Singh et al.", + strict=[ + :doctest, + :linkcheck, + :parse_error, + :example_block, + # Other available options are + # :autodocs_block, :cross_references, :docs_block, :eval_block, :example_block, + # :footnote, :meta_block, :missing_docs, :setup_block + ], checkdocs=:all, format=Markdown(), draft=false, + build=joinpath(@__DIR__, "docs") +) + +deploydocs(; repo="github.com/TidierOrg/TidierDB.jl.git", push_preview=true, + deps=Deps.pip("mkdocs", "pygments", "python-markdown-math", "mkdocs-material", + "pymdown-extensions", "mkdocstrings", "mknotebooks", + "pytkdocs_tweaks", "mkdocs_include_exclude_files", "jinja2"), + make=() -> run(`mkdocs build`), target="site", devbranch="main") \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 0000000..4f08515 --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,120 @@ +theme: + name: material + logo: assets/TidierDB_logo.png + features: + - content.code.copy + # - announce.dismiss + - content.code.annotate + # - content.tabs.link + #- content.tooltips + # - header.autohide + # - navigation.expand + #- navigation.indexes + # - navigation.instant + # - navigation.prune + #- navigation.sections + #- navigation.tabs + # - navigation.tabs.sticky + - navigation.top + - navigation.footer + #- navigation.tracking + - search.highlight + - search.share + - search.suggest + - toc.follow + #- toc.integrate # Table of contents is integrated on the left; does not appear separately on the right. + - header.autohide # header disappears as you scroll + palette: + + # Light mode + - media: "(prefers-color-scheme: light)" + scheme: default + primary: deep purple + accent: purple + toggle: + icon: material/weather-sunny + name: Switch to dark mode + + # Dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: purple + accent: purple + toggle: + icon: material/weather-night + name: Switch to light mode + font: + text: Lato + icon: + repo: fontawesome/brands/github # GitHub logo in top right + #logo: "material/gridoff" # Equinox logo in top left + # favicon: "_static/icon_transparent.svg" + custom_dir: "_overrides" # Overriding part of the HTML + + # These additions are my own custom ones, having overridden a partial. + #twitter_name: "" + #twitter_url: "" +site_name: TidierDB.jl +site_description: TidierDB.jl +site_author: Lazaro Alonso and Karandeep Singh +site_url: "" + +repo_url: https://github.com/TidierOrg/TidierDB.jl +repo_name: TidierDB.jl +edit_uri: "" # No edit button, as some of our pages are in /docs and some in /examples via symlink, so it's impossible for them all to be accurate + +strict: true # Don't allow warnings during the build process +extra_javascript: + # The below three make MathJax work, see https://squidfunk.github.io/mkdocs-material/reference/mathjax/ + - _static/mathjax.js + - https://polyfill.io/v3/polyfill.min.js?features=es6 + - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js + +extra: + social: + - icon: fontawesome/brands/github + link: https://github.com/kdpsingh + - icon: fontawesome/brands/twitter + link: https://twitter.com/kdpsinghlab + +extra_css: + - stylesheets/custom.css + - assets/Documenter.css + +extra_javascript: + - javascripts/mathjax.js + - https://polyfill.io/v3/polyfill.min.js?features=es6 + - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js + +markdown_extensions: + - tables + - admonition + - toc: + permalink: "ยค" # Adds a clickable permalink to each section heading + toc_depth: 4 + - pymdownx.arithmatex: # Render LaTeX via MathJax + generic: true + - pymdownx.details # Allowing hidden expandable regions denoted by ??? + - pymdownx.highlight + - pymdownx.inlinehilite + - pymdownx.snippets + - pymdownx.superfences # Seems to enable syntax highlighting when used with the Material theme. + - pymdownx.tasklist: + custom_checkbox: true + - def_list + - pymdownx.tabbed: + alternate_style: true + - attr_list + - md_in_html +plugins: + - search # default search plugin; needs manually re-enabling when using any other plugins + - autorefs # Cross-links to headings + - include_exclude_files: + exclude: + - "_overrides" +# - mknotebooks # Jupyter notebooks + #- mkdocs-video +nav: + - "Home": "index.md" + - "Key Differences from TidierData.jl" : "examples/generated/UserGuide/key_differences.md" + - "Reference" : "reference.md" \ No newline at end of file diff --git a/docs/src/javascripts/mathjax.js b/docs/src/javascripts/mathjax.js new file mode 100644 index 0000000..a80ddbf --- /dev/null +++ b/docs/src/javascripts/mathjax.js @@ -0,0 +1,16 @@ +window.MathJax = { + tex: { + inlineMath: [["\\(", "\\)"]], + displayMath: [["\\[", "\\]"]], + processEscapes: true, + processEnvironments: true + }, + options: { + ignoreHtmlClass: ".*|", + processHtmlClass: "arithmatex" + } +}; + +document$.subscribe(() => { + MathJax.typesetPromise() +}) \ No newline at end of file diff --git a/docs/src/reference.md b/docs/src/reference.md new file mode 100644 index 0000000..d6ce61a --- /dev/null +++ b/docs/src/reference.md @@ -0,0 +1,22 @@ +```@meta +DocTestSetup= quote +using TidierDB +end +``` +## Index +```@index +Modules = [TidierDB] +Private = false +``` + +## Reference - Exported functions +```@autodocs +Modules = [TidierDB] +Private = false +``` + +## Reference - Internal functions +```@autodocs +Modules = [TidierDB] +Public = false +``` \ No newline at end of file diff --git a/docs/src/stylesheets/custom.css b/docs/src/stylesheets/custom.css new file mode 100644 index 0000000..84d99c0 --- /dev/null +++ b/docs/src/stylesheets/custom.css @@ -0,0 +1,157 @@ +/* Fix /page#foo going to the top of the viewport and being hidden by the navbar */ +html { + scroll-padding-top: 50px; + } + + /* Fit the Twitter handle alongside the GitHub one in the top right. */ + + div.md-header__source { + width: revert; + max-width: revert; + } + + a.md-source { + display: inline-block; + } + + .md-source__repository { + max-width: 100%; + } + + /* Emphasise sections of nav on left hand side */ + + nav.md-nav { + padding-left: 5px; + } + + nav.md-nav--secondary { + border-left: revert !important; + } + + .md-nav__title { + font-size: 0.9rem; + } + + .md-nav__item--section > .md-nav__link { + font-size: 0.9rem; + } + + /* Indent autogenerated documentation */ + + div.doc-contents { + padding-left: 25px; + border-left: 4px solid rgba(230, 230, 230); + } + + /* Increase visibility of splitters "---" */ + + [data-md-color-scheme="default"] .md-typeset hr { + border-bottom-color: rgb(0, 0, 0); + border-bottom-width: 1pt; + } + + [data-md-color-scheme="slate"] .md-typeset hr { + border-bottom-color: rgb(230, 230, 230); + } + + /* More space at the bottom of the page */ + + .md-main__inner { + margin-bottom: 1.5rem; + } + + /* Remove prev/next footer buttons */ + + .md-footer__inner { + display: none; + } + + /* Bugfix: remove the superfluous parts generated when doing: + + ??? Blah + + ::: library.something + */ + + .md-typeset details .mkdocstrings > h4 { + display: none; + } + + .md-typeset details .mkdocstrings > h5 { + display: none; + } + + /* Change default colours for tags */ + + [data-md-color-scheme="default"] { + --md-typeset-a-color: rgb(0, 150, 255) !important; + } + [data-md-color-scheme="slate"] { + --md-typeset-a-color: rgb(0, 150, 255) !important; + } + + /* Highlight functions, classes etc. type signatures. Really helps to make clear where + one item ends and another begins. */ + + [data-md-color-scheme="default"] { + --doc-heading-color: #DDD; + --doc-heading-border-color: #CCC; + --doc-heading-color-alt: #F0F0F0; + } + [data-md-color-scheme="slate"] { + --doc-heading-color: rgb(25,25,33); + --doc-heading-border-color: rgb(25,25,33); + --doc-heading-color-alt: rgb(33,33,44); + --md-code-bg-color: rgb(38,38,50); + } + + h4.doc-heading { + /* NOT var(--md-code-bg-color) as that's not visually distinct from other code blocks.*/ + background-color: var(--doc-heading-color); + border: solid var(--doc-heading-border-color); + border-width: 1.5pt; + border-radius: 2pt; + padding: 0pt 5pt 2pt 5pt; + } + h5.doc-heading, h6.heading { + background-color: var(--doc-heading-color-alt); + border-radius: 2pt; + padding: 0pt 5pt 2pt 5pt; + } + + /* From Pretty Pandas Dataframes */ +/* Supports mkdocs-material color variables */ +.data-frame { + border: 0; + font-size: smaller; +} +.data-frame tr { + border: none; + background: var(--md-code-bg-color, #ffffff); +} +.data-frame tr:nth-child(even) { + background: var(--md-default-bg-color, #f5f5f5); +} +.data-frame tr:hover { + background-color: var(--md-footer-bg-color--dark, #e1f5fe); +} + +.data-frame thead th { + background: var(--md-default-bg-color, #ffffff); + border-bottom: 1px solid #aaa; + font-weight: bold; +} +.data-frame th { + border: none; + padding-left: 10px; + padding-right: 10px; +} + +.data-frame td{ + /* background: #fff; */ + border: none; + text-align: right; + min-width:5em; + padding-left: 10px; + padding-right: 10px; +} \ No newline at end of file