-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
/
ford.rb
194 lines (168 loc) 路 8.63 KB
/
ford.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
class Ford < Formula
include Language::Python::Virtualenv
desc "Automatic documentation generator for modern Fortran programs"
homepage "https://github.com/Fortran-FOSS-Programmers/ford"
url "https://files.pythonhosted.org/packages/fe/45/fbb50a9ce7fb8740b8365fae80d7a3247202c6698672b67acdea188751f4/FORD-7.0.6.tar.gz"
sha256 "662d0cab60234743ed7b863fbb980e0af909f31e0205011d7978ea2dedc3e952"
license "GPL-3.0-or-later"
revision 1
head "https://github.com/Fortran-FOSS-Programmers/ford.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, arm64_sonoma: "3386d8cc4f37dfa3e73f486c98689b4a0e05406b4d191209a45761a5a908ab03"
sha256 cellar: :any_skip_relocation, arm64_ventura: "27435d9550543d93472e829e55ec8ce5bf7ccd3ecb099599be42a63bc01b194d"
sha256 cellar: :any_skip_relocation, arm64_monterey: "fd5bb0e9e66a8ff21a094d3cd1a0760d5a551bfd8bc7613fae54bbfcebec33dd"
sha256 cellar: :any_skip_relocation, sonoma: "4433ddbac554a53a95e953dec38fd51096e2df839b96c8e8c651a5bf677f875c"
sha256 cellar: :any_skip_relocation, ventura: "5d2ac1f779a55e3b2b79d73c0633de1043dad9b85feb67ae78b78d382bef467d"
sha256 cellar: :any_skip_relocation, monterey: "e5eb67c563a17d422fd9ad274d52e34d2ddcdf9e1490cbcd2c90ef1c397b9953"
sha256 cellar: :any_skip_relocation, x86_64_linux: "cc534d0defa8049f075162df856d0e8305b31b4fa6f3cc46310184c68f535f90"
end
depends_on "graphviz"
depends_on "python@3.12"
resource "beautifulsoup4" do
url "https://files.pythonhosted.org/packages/b3/ca/824b1195773ce6166d388573fc106ce56d4a805bd7427b624e063596ec58/beautifulsoup4-4.12.3.tar.gz"
sha256 "74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051"
end
resource "graphviz" do
url "https://files.pythonhosted.org/packages/fa/83/5a40d19b8347f017e417710907f824915fba411a9befd092e52746b63e9f/graphviz-0.20.3.zip"
sha256 "09d6bc81e6a9fa392e7ba52135a9d49f1ed62526f96499325930e87ca1b5925d"
end
resource "jinja2" do
url "https://files.pythonhosted.org/packages/ed/55/39036716d19cab0747a5020fc7e907f362fbf48c984b14e62127f7e68e5d/jinja2-3.1.4.tar.gz"
sha256 "4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369"
end
resource "markdown" do
url "https://files.pythonhosted.org/packages/87/2a/62841f4fb1fef5fa015ded48d02401cd95643ca03b6760b29437b62a04a4/Markdown-3.4.4.tar.gz"
sha256 "225c6123522495d4119a90b3a3ba31a1e87a70369e03f14799ea9c0d7183a3d6"
end
resource "markdown-include" do
url "https://files.pythonhosted.org/packages/5d/9c/7f53ad33ec7b7243910f8a5c3335c895fb070dc21b2e38b5a38d6a966c0c/markdown-include-0.7.2.tar.gz"
sha256 "84070d0244367f99bdf9bbdd49ff7b9f51517bbee7582ad7aa8ff363e30d8157"
end
resource "markdown-it-py" do
url "https://files.pythonhosted.org/packages/38/71/3b932df36c1a044d397a1f92d1cf91ee0a503d91e470cbd670aa66b07ed0/markdown-it-py-3.0.0.tar.gz"
sha256 "e3f60a94fa066dc52ec76661e37c851cb232d92f9886b15cb560aaada2df8feb"
end
resource "markupsafe" do
url "https://files.pythonhosted.org/packages/87/5b/aae44c6655f3801e81aa3eef09dbbf012431987ba564d7231722f68df02d/MarkupSafe-2.1.5.tar.gz"
sha256 "d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"
end
resource "mdurl" do
url "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz"
sha256 "bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"
end
resource "pcpp" do
url "https://files.pythonhosted.org/packages/41/07/876153f611f2c610bdb8f706a5ab560d888c938ea9ea65ed18c374a9014a/pcpp-1.30.tar.gz"
sha256 "5af9fbce55f136d7931ae915fae03c34030a3b36c496e72d9636cedc8e2543a1"
end
resource "pygments" do
url "https://files.pythonhosted.org/packages/8e/62/8336eff65bcbc8e4cb5d05b55faf041285951b6e80f33e2bff2024788f31/pygments-2.18.0.tar.gz"
sha256 "786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199"
end
resource "python-markdown-math" do
url "https://files.pythonhosted.org/packages/ec/17/e7e3f3fce951b8adec10987834f4b2fa721ebd9bd6651ce2a4f39c4c544d/python-markdown-math-0.8.tar.gz"
sha256 "8564212af679fc18d53f38681f16080fcd3d186073f23825c7ce86fadd3e3635"
end
resource "rich" do
url "https://files.pythonhosted.org/packages/b3/01/c954e134dc440ab5f96952fe52b4fdc64225530320a910473c1fe270d9aa/rich-13.7.1.tar.gz"
sha256 "9be308cb1fe2f1f57d67ce99e95af38a1e2bc71ad9813b0e247cf7ffbcc3a432"
end
resource "soupsieve" do
url "https://files.pythonhosted.org/packages/ce/21/952a240de1c196c7e3fbcd4e559681f0419b1280c617db21157a0390717b/soupsieve-2.5.tar.gz"
sha256 "5663d5a7b3bfaeee0bc4372e7fc48f9cff4940b3eec54a6451cc5299f1097690"
end
resource "toposort" do
url "https://files.pythonhosted.org/packages/b2/be/67bec9a73041616dd359f06e997d56c9c99d252460a3f035411d97c96c48/toposort-1.7.tar.gz"
sha256 "ddc2182c42912a440511bd7ff5d3e6a1cabc3accbc674a3258c8c41cbfbb2125"
end
resource "tqdm" do
url "https://files.pythonhosted.org/packages/c1/c2/d8a40e5363fb01806870e444fc1d066282743292ff32a9da54af51ce36a2/tqdm-4.64.1.tar.gz"
sha256 "5f4f682a004951c1b450bc753c710e9280c5746ce6ffedee253ddbcbf54cf1e4"
end
def install
virtualenv_install_with_resources
doc.install "2008standard.pdf", "2003standard.pdf"
pkgshare.install "example/example-project-file.md"
end
test do
(testpath/"test-project.md").write <<~EOS
project: Example Project
summary: This is a short example project
that demonstrates many of Ford's features
src_dir: ./src
output_dir: ./doc
project_github: https://github.com/cmacmackin/futility
project_website: https://github.com
summary: Some Fortran program which I wrote.
author: John Doe
author_description: I program stuff in Fortran.
github: https://github.com/cmacmackin
email: john.doe@example.com
fpp_extensions: fpp
preprocess: false
macro: HAS_DECREMENT
predocmark: >
docmark_alt: #
predocmark_alt: <
display: public
protected
source: false
graph: true
search: true
extra_mods: json_module: http://jacobwilliams.github.io/json-fortran/
futility: http://cmacmackin.github.io
license: by-nc
extra_filetypes: sh #
max_frontpage_items: 4
exclude: src/excluded_file.f90
exclude_dir: src/excluded_directory
page_dir: pages
---
This is a project which I wrote. This file will provide the documents. I'm
writing the body of the text here. It contains an overall description of the
project. It might explain how to go about installing/compiling it. It might
provide a change-log for the code. Maybe it will talk about the history and/or
motivation for this software.
@Note
You can include any notes (or bugs, warnings, or todos) like so.
You can have as many paragraphs as you like here and can use headlines, links,
images, etc. Basically, you can use anything in Markdown and Markdown-Extra.
Furthermore, you can insert LaTeX into your documentation. So, for example,
you can provide inline math using like ( y = x^2 ) or math on its own line
like [ x = \sqrt{y} ] or $$ e = mc^2. $$ You can even use LaTeX environments!
So you can get numbered equations like this:
\begin{equation}
PV = nRT
\end{equation}
So let your imagination run wild. As you can tell, I'm more or less just
filling in space now. This will be the last sentence.
EOS
mkdir testpath/"src" do
(testpath/"src"/"ford_test_program.f90").write <<~EOS
program ford_test_program
!! Simple Fortran program to demonstrate the usage of FORD and to test its installation
use iso_fortran_env, only: output_unit, real64
implicit none
real (real64) :: global_pi = acos(-1)
!! a global variable, initialized to the value of pi
write(output_unit,'(A)') 'Small test program'
call do_stuff(20)
contains
subroutine do_stuff(repeat)
!! This is documentation for our subroutine that does stuff and things.
!! This text is captured by ford
integer, intent(in) :: repeat
!! The number of times to repeatedly do stuff and things
integer :: i
!! internal loop counter
! the main content goes here and this is comment is not processed by FORD
do i=1,repeat
global_pi = acos(-1)
end do
end subroutine
end program
EOS
end
system bin/"ford", testpath/"test-project.md"
assert_predicate testpath/"doc"/"index.html", :exist?
end
end