Skip to content

Commit 947e300

Browse files
gallaisMatthewDaggitt
authored andcommitted
[ fix #1743 ] move README to doc/ directory (#2184)
* [ admin ] dev playground * [ fix #1743 ] move README to doc/ directory * [ fix ] whitespace violations * [ ci ] update to cope with new doc/ directory * [ cleanup ] remove stale reference to travis.yml * [ admin ] update README-related instructions * [ admin ] fix build badges * [ fix ] `make test` build * Moved contents of notes/ to doc/ * Added CHANGELOG entry --------- Co-authored-by: MatthewDaggitt <[email protected]>
1 parent e7d8642 commit 947e300

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+76
-43
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

.github/workflows/ci-ubuntu.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ env:
5151
CABAL_VERSION: 3.6.2.0
5252
CABAL_INSTALL: cabal v1-install --ghc-options='-O1 +RTS -M6G -RTS'
5353
# CABAL_INSTALL: cabal install --overwrite-policy=always --ghc-options='-O1 +RTS -M6G -RTS'
54-
AGDA: agda -Werror +RTS -M3.5G -H3.5G -A128M -RTS -i. -i src/
54+
AGDA: agda -Werror +RTS -M3.5G -H3.5G -A128M -RTS -i. -isrc -idoc
5555

5656
jobs:
5757
test-stdlib:
@@ -152,7 +152,7 @@ jobs:
152152
- name: Test stdlib
153153
run: |
154154
cabal run GenerateEverything
155-
cp travis/* .
155+
cp .github/tooling/* .
156156
./index.sh
157157
${{ env.AGDA }} --safe EverythingSafe.agda
158158
${{ env.AGDA }} index.agda
@@ -178,7 +178,7 @@ jobs:
178178
rm -f '${{ env.AGDA_HTML_DIR }}'/*.css
179179
${{ env.AGDA }} --html --html-dir ${{ env.AGDA_HTML_DIR }} index.agda
180180
181-
cp travis/* .
181+
cp .github/tooling/* .
182182
./landing.sh
183183
184184
- name: Deploy HTML

CHANGELOG.md

+11

GNUmakefile

+7-3
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,27 @@ AGDA=$(AGDA_EXEC) $(AGDA_OPTIONS) $(AGDA_RTS_OPTIONS)
99
# cabal install fix-whitespace
1010

1111
test: Everything.agda check-whitespace
12-
$(AGDA) -i. -isrc README.agda
12+
cd doc && $(AGDA) README.agda
1313

1414
testsuite:
1515
$(MAKE) -C tests test AGDA="$(AGDA)" AGDA_EXEC="$(AGDA_EXEC)" only=$(only)
1616

17+
fix-whitespace:
18+
cabal exec -- fix-whitespace
19+
1720
check-whitespace:
1821
cabal exec -- fix-whitespace --check
1922

2023
setup: Everything.agda
2124

2225
.PHONY: Everything.agda
2326
Everything.agda:
24-
cabal run GenerateEverything
27+
cabal run GenerateEverything -- --out-dir doc
2528

2629
.PHONY: listings
2730
listings: Everything.agda
28-
$(AGDA) -i. -isrc --html README.agda -v0
31+
cd doc && $(AGDA) --html README.agda -v0
2932

3033
clean :
3134
find . -type f -name '*.agdai' -delete
35+
rm -f Everything.agda EverythingSafe.agda

GenerateEverything.hs

+30-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE PatternGuards #-}
22
{-# LANGUAGE PatternSynonyms #-}
3+
{-# LANGUAGE RecordWildCards #-}
34

45
import Control.Applicative
56
import Control.Monad
@@ -299,18 +300,37 @@ checkFilePaths cat fps = forM_ fps $ \ fp -> do
299300
unless b $
300301
die $ fp ++ " is listed as " ++ cat ++ " but does not exist."
301302

303+
data Options = Options
304+
{ includeDeprecated :: Bool
305+
, outputDirectory :: FilePath
306+
}
307+
308+
initOptions :: Options
309+
initOptions = Options
310+
{ includeDeprecated = False
311+
, outputDirectory = "."
312+
}
313+
314+
parseOptions :: [String] -> Options -> Maybe Options
315+
parseOptions [] opts = pure opts
316+
parseOptions ("--include-deprecated" : rest) opts
317+
= parseOptions rest (opts { includeDeprecated = True })
318+
parseOptions ("--out-dir" : dir : rest) opts
319+
= parseOptions rest (opts { outputDirectory = dir })
320+
parseOptions _ _ = Nothing
321+
302322
---------------------------------------------------------------------------
303323
-- Collecting all non-Core library files, analysing them and generating
304-
-- 4 files:
324+
-- 2 files:
305325
-- Everything.agda all the modules
306326
-- EverythingSafe.agda all the safe modules
307327

328+
main :: IO ()
308329
main = do
309330
args <- getArgs
310-
includeDeprecated <- case args of
311-
[] -> return False
312-
["--include-deprecated"] -> return True
313-
_ -> hPutStr stderr usage >> exitFailure
331+
Options{..} <- case parseOptions args initOptions of
332+
Just opts -> pure opts
333+
Nothing -> hPutStr stderr usage >> exitFailure
314334

315335
checkFilePaths "unsafe" unsafeModules
316336
checkFilePaths "using K" withKModules
@@ -325,14 +345,14 @@ main = do
325345

326346
let mkModule str = "module " ++ str ++ " where"
327347

328-
writeFileUTF8 (allOutputFile ++ ".agda") $
348+
writeFileUTF8 (outputDirectory ++ "/" ++ allOutputFile ++ ".agda") $
329349
unlines [ header
330350
, "{-# OPTIONS --rewriting --guardedness --sized-types #-}\n"
331351
, mkModule allOutputFile
332352
, format libraryfiles
333353
]
334354

335-
writeFileUTF8 (safeOutputFile ++ ".agda") $
355+
writeFileUTF8 (outputDirectory ++ "/" ++ safeOutputFile ++ ".agda") $
336356
unlines [ header
337357
, "{-# OPTIONS --safe --guardedness #-}\n"
338358
, mkModule safeOutputFile
@@ -353,6 +373,9 @@ usage = unlines
353373
, "The program generates documentation for the library by extracting"
354374
, "headers from library modules. The output is written to " ++ allOutputFile
355375
, "with the file " ++ headerFile ++ " inserted verbatim at the beginning."
376+
, ""
377+
, "If the option --out-dir is used then the output is placed in the"
378+
, "subdirectory thus selected."
356379
]
357380

358381

HACKING.md

+8-17

README.md

+2-2

dev/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*

dev/README.md

+4

dev/experimental.agda-lib

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: standard-library-dev
2+
include: . ../src
3+
flags:
4+
--warning=noUnsupportedIndexedMatch

README.agda doc/README.agda

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

README/IO.agda doc/README/IO.agda

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

notes/release-guide.txt doc/release-guide.txt

+2-10
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,12 @@ procedure should be followed:
6161
* Announce the release of the new version on the Agda mailing lists
6262
(users and developers).
6363

64-
* Add v$VERSION to the list of protected directories in the .travis.yml
65-
file of BOTH master and experimental. They should look something like:
66-
67-
> git checkout HEAD -- v0.16/ v0.17/ v1.0/ v1.1/ (...)
68-
69-
Commit & push these changes. This will prevent the next step from being
70-
overwritten by travis.
71-
7264
* Generate and upload documentation for the released version:
7365

74-
cp travis/* .
66+
cp .github/tooling/* .
7567
runhaskell GenerateEverything.hs
7668
./index.sh
77-
agda -i. -isrc --html index.agda
69+
agda -i. -idoc -isrc --html index.agda
7870
mv html v$VERSION
7971
git checkout gh-pages
8072
git add v$VERSION/*.html v$VERSION/*.css

doc/standard-library-doc.agda-lib

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: standard-library-doc
2+
include: . ../src
3+
flags:
4+
--warning=noUnsupportedIndexedMatch
File renamed without changes.

fix-whitespace.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ included-dirs:
55
included-files:
66
- "*.agda"
77
- "*.md"
8-
- ".travis.yml"
98

109
excluded-files:
1110
- "README/Text/Tabular.agda"

0 commit comments

Comments
 (0)