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

Ac/package updates #2

Merged
Merged
Show file tree
Hide file tree
Changes from 7 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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name = "SIIP-Package"
name = "SiennaTemplate"
uuid = "bed98974-b02a-5e2f-9ee0-a103f5c450dd"
authors = ["YOUR_NAME"]
version = "0.1.0"
Expand Down
3 changes: 2 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
SiennaTemplate = "bed98974-b02a-5e2f-9ee0-a103f5c450dd"

annacasavant marked this conversation as resolved.
Show resolved Hide resolved
[compat]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a requirement for:
Documenter = "1"

Documenter = "0.27"
julia = "^1.6"
63 changes: 36 additions & 27 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
using Documenter, SIIP - PACKAGE

pages = OrderedDict(
"Welcome Page" => "index.md",
"Quick Start Guide" => "quick_start_guide.md",
"Tutorials" => "tutorials/intro_page.md",
"Public API Reference" => "api/public.md",
"Internal API Reference" => "api/internal.md",
)

makedocs(
modules=[SIIP-PACKAGE],
format=Documenter.HTML(prettyurls=haskey(ENV, "GITHUB_ACTIONS")),
sitename="SIIP-PACKAGE.jl",
authors="Freddy Mercury, Nikola Tesla, Leonard Bernestein",
pages=Any[p for p in pages],
)

deploydocs(
repo="github.com/NREL-SIIP/SIIP-PACKAGE.git",
target="build",
branch="gh-pages",
devbranch="master",
devurl="dev",
push_preview=true,
versions=["stable" => "v^", "v#.#"],
)
using Documenter
import DataStructures: OrderedDict
using SiennaTemplate

pages = OrderedDict(
"Welcome Page" => "index.md",
"Tutorials" => Any["stub" => "tutorials/stub.md"],
"How to..." => Any["stub" => "how_to_guides/stub.md"],
"Explanation" => Any["stub" => "explanation/stub.md"],
"Reference" => Any[
"Public API" => "reference/public.md",
"Internals" => "reference/internal.md",
],
annacasavant marked this conversation as resolved.
Show resolved Hide resolved
)

makedocs(
modules = [SiennaTemplate],
format = Documenter.HTML(
prettyurls = haskey(ENV, "GITHUB_ACTIONS"),
size_threshold = nothing,),
sitename = "github.com/NREL-Sienna/SiennaTemplate.jl",
authors = "Freddy Mercury",
pages = Any[p for p in pages],
draft = false,
)

deploydocs(
repo="github.com/annacasavant/SiennaTempalte.jl",
annacasavant marked this conversation as resolved.
Show resolved Hide resolved
target="build",
branch="gh-pages",
devbranch="master",
devurl="dev",
push_preview=true,
versions=["stable" => "v^", "v#.#"],
)

1 change: 1 addition & 0 deletions docs/src/explanation/stub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please refer to the [Explanation](https://diataxis.fr/explanation/) section of the diataxis framework.
1 change: 1 addition & 0 deletions docs/src/how_to_guides/stub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please refer to the [How-to-Guides](https://diataxis.fr/how-to-guides/) section of the diataxis framework.
7 changes: 4 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# PowerSystems.jl

```@meta
CurrentModule = SIIP_PACKAGE
CurrentModule = SiennaTemplate
```

## Overview

`PSIIP-PACKAGE .jl` is a [`Julia`](http://www.julialang.org) package that provides blah blah
`SiennaTemplate.jl` is a [`Julia`](http://www.julialang.org) package that provides blah blah

* * *

------------
SIIP-PACKAGE has been developed as part of the Scalable Integrated Infrastructure Planning
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we replace this with the same About stub from power systems?

Screenshot 2024-11-08 at 2 03 05 PM

(SIIP) initiative at the U.S. Department of Energy's National Renewable Energy
Laboratory ([NREL](https://www.nrel.gov/)).
6 changes: 6 additions & 0 deletions docs/src/reference/internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Internal API

```@autodocs
Modules = [SiennaTemplate]
Public = false
```
6 changes: 6 additions & 0 deletions docs/src/reference/public.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Public API Reference

```@autodocs
Modules = [SiennaTemplate]
Public = true
```
1 change: 1 addition & 0 deletions docs/src/reference/stub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please refer to the [Reference](https://diataxis.fr/reference/) section of the diataxis framework.
1 change: 1 addition & 0 deletions docs/src/tutorials/stub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please refer to the [Tutorial](https://diataxis.fr/tutorials/) section of the diataxis framework.
69 changes: 28 additions & 41 deletions scripts/formatter/formatter_code.jl
Original file line number Diff line number Diff line change
@@ -1,41 +1,28 @@
using Pkg
Pkg.activate(@__DIR__)
Pkg.instantiate()
using JuliaFormatter

main_paths = [".", "./docs/src"]
for main_path in main_paths
format(
main_path;
whitespace_ops_in_indices=true,
remove_extra_newlines=true,
verbose=true,
always_for_in=true,
whitespace_typedefs=true,
whitespace_in_kwargs=false,
format_docstrings=true,
always_use_return=false, # removed since it has false positives.
)
end

# Documentation Formatter
main_paths = ["./docs/src"]
for main_path in main_paths
for folder in readdir(main_path)
@show folder_path = joinpath(main_path, folder)
if isfile(folder_path)
!occursin(".md", folder_path) && continue
end
format(
folder_path;
format_markdown=true,
whitespace_ops_in_indices=true,
remove_extra_newlines=true,
verbose=true,
always_for_in=true,
whitespace_typedefs=true,
whitespace_in_kwargs=false,
# always_use_return = true # removed since it has false positives.
)
end
end
using Pkg
Pkg.activate(@__DIR__)
Pkg.instantiate()
using JuliaFormatter

main_paths = ["./src", "./test", "./docs/src"]
for main_path in main_paths
for (root, dir, files) in walkdir(main_path)
for f in files
@show file_path = abspath(root, f)
!((occursin(".jl", f) || occursin(".md", f))) && continue
format(file_path;
whitespace_ops_in_indices = true,
remove_extra_newlines = true,
verbose = true,
always_for_in = true,
whitespace_typedefs = true,
conditional_to_if = true,
join_lines_based_on_source = true,
separate_kwargs_with_semicolon = true,
format_markdown = true,
#ignore = [] # list of file that cause formatter to error

# always_use_return = true. # Disabled since it throws a lot of false positives
)
end
end
end
9 changes: 9 additions & 0 deletions src/SiennaTemplate.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module SiennaTemplate
using DocStringExtensions

@template (FUNCTIONS, METHODS) = """
$(TYPEDSIGNATURES)
$(DOCSTRING)
"""

end
10 changes: 5 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ using Test
import Logging

import Aqua
Aqua.test_unbound_args(SIIP - PACKAGE)
Aqua.test_undefined_exports(SIIP - PACKAGE)
Aqua.test_ambiguities(SIIP - PACKAGE)
Aqua.test_stale_deps(SIIP - PACKAGE)
Aqua.test_deps_compat(SIIP - PACKAGE)
Aqua.test_unbound_args(SiennaTemplate)
Aqua.test_undefined_exports(SiennaTemplate)
Aqua.test_ambiguities(SiennaTemplate)
Aqua.test_stale_deps(SiennaTemplate)
Aqua.test_deps_compat(SiennaTemplate)

LOG_FILE = "power-systems.log"
LOG_LEVELS = Dict(
Expand Down