├── .gitignore
├── .swiftpm
└── xcode
│ └── package.xcworkspace
│ └── contents.xcworkspacedata
├── Package.swift
├── README.md
├── html
├── Basic.swift.html
├── ByteRegex.swift.html
├── Client.swift.html
├── ClientCapabilities.swift.html
├── Contents.swift.html
├── DataTransport.swift.html
├── Declaration.swift.html
├── Definition.swift.html
├── Diagnostics.swift.html
├── DocumentSymbol.swift.html
├── FoldingRange.swift.html
├── Formatting.swift.html
├── GitInfo.swift.html
├── Hover.swift.html
├── Implementation.swift.html
├── Initialization.swift.html
├── Initialized.swift.html
├── JSONRPC+Helpers.swift.html
├── JSONRPC.swift.html
├── JSONRPCLanguageServer.swift.html
├── JSONRPCLanguageServerTests.swift.html
├── JSONValue.swift.html
├── LSPRange.swift.html
├── LanguageFeatures.swift.html
├── LanguageServer.swift.html
├── LanguageServerProcessHost.swift.html
├── LanguageServerProtocol.h.html
├── LineGenerators.swift.html
├── Location.swift.html
├── LocationLink.swift.html
├── LogMessageParams.swift.html
├── MessageActionItem.swift.html
├── MessageTransport.swift.html
├── MessageTransportTests.swift.html
├── MessageType.swift.html
├── MockDataTransport.swift.html
├── MockProtocolTransportMessage.swift.html
├── Package.swift.html
├── Package.swift_.html
├── Package.swift__.html
├── Package.swift___.html
├── Package.swift____.html
├── Package.swift_____.html
├── Parallel.swift.html
├── Position.swift.html
├── ProtocolMethod.swift.html
├── ProtocolTransport.swift.html
├── ProtocolTransportTests.swift.html
├── Reference.swift.html
├── Resources.swift.html
├── ServerCapabilities.swift.html
├── ShowMessageParams.swift.html
├── ShowMessageRequest.swift.html
├── SignatureHelp.swift.html
├── Siteify.swift.html
├── SourceKit.swift.html
├── StdioDataTransport.swift.html
├── SwiftRegex5.h.html
├── SwiftRegex5Tests.swift.html
├── SymbolKind.swift.html
├── Synchronizer.swift.html
├── TextDocumentClientCapabilitiesGenericGoTo.swift.html
├── TextDocumentIndentifier.swift.html
├── TextSynchronization.swift.html
├── TupleRegex.swift.html
├── TupleRegex.swift_.html
├── TypeDefinition.swift.html
├── TypeTests.swift.html
├── WillSaveTextDocument.swift.html
├── WorkspaceFolder.swift.html
├── canviz-0.1
│ ├── LICENSE.txt
│ ├── README.txt
│ ├── canviz.css
│ ├── canviz.js
│ ├── path.js
│ └── prototype.js
├── canviz.gv
├── canviz.html
├── checkouts-state.json.html
├── dependencies-state.json.html
├── index.html
├── main.swift.html
├── siteify-Bridging-Header.h.html
├── siteify.css
├── siteify.js
├── sourcekitd.h.html
├── sourcekitd.h_.html
└── symbols.html
├── siteify.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── xcshareddata
│ └── xcschemes
│ └── siteify.xcscheme
└── siteify
├── ByteRegex.swift
├── Resources.swift
├── Siteify.swift
├── SourceKit.swift
├── Synchronizer.swift
├── main.swift
├── siteify-Bridging-Header.h
└── sourcekitd.h
/.gitignore:
--------------------------------------------------------------------------------
1 | build/*
2 | *Library/*
3 | *xcuserdata*
4 | .build/*
5 |
--------------------------------------------------------------------------------
/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.0
2 | // The swift-tools-version declares the minimum version of Swift required to build this package.
3 |
4 | import PackageDescription
5 |
6 | let package = Package(
7 | name: "siteify",
8 | platforms: [.macOS("10.12")],
9 | products: [
10 | .executable(name: "siteify", targets: ["siteify"]),
11 | ],
12 | dependencies: [
13 | .package(url: "https://github.com/johnno1962/SourceKitHeader.git", .branch("master")),
14 | .package(url: "https://github.com/johnno1962/Parallel.git", .branch("master")),
15 | .package(url: "https://github.com/johnno1962/GitInfo.git", .branch("master")),
16 | .package(url: "https://github.com/ChimeHQ/SwiftLSPClient.git", .branch("master")),
17 | ],
18 | targets: [
19 | .target(name: "siteify", dependencies: ["SwiftLSPClient", "Parallel", "GitInfo"], path: "siteify/"),
20 | ]
21 | )
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | ## siteify - Build a hyperlinked Web Site from project's Swift sources.
3 |
4 | Created as a means of testing SourceKit but useful more generally as a mean for browsing
5 | source code, `siteify` is a Swift program that creates a hyperlinked HTML reference of a
6 | project that can be built with the Swift Package Manager and be navigated in a Web Browser.
7 | Links over symbol references take you to their definition and clicking on the link on a definition
8 | will list links for the places the symbol is referenced.
9 |
10 | For example, the source of this project is available to browse [here](http://johnholdsworth.com/siteify/html/).
11 |
12 | 
13 |
14 | To use, download, and build this project using Xcode or Swift Package Manager. After the
15 | Xcode build completes, the binary is installed as `~/bin/siteify`. Using SPM, use
16 | `swift build` and copy `.build/debug/siteify` to `~/bin`.
17 |
18 | _cd_ into the root the SPM project you wish to document and run `swift build` in
19 | order to update its index then type `~/bin/siteify`. You'll need to download a recent
20 | development toolchain from [swift.org](https://swift.org/download/) to get the required
21 | `sourcekit-lsp` executable. `siteify` can take a command line argument which is
22 | the SPM repo to process but always places the generated html in the directory `html`
23 | created in the current working directory and opens the file `html/index.html`.
24 |
25 | ### SPM dependencies
26 |
27 | Having started as Xcode project, eventually I wanted to start using SPM dependencies
28 | so the project contains a script [pre-action.sh](pre-action.sh) which allows you to include
29 | SPM dependencies as frameworks during the transition.
30 |
31 | ### Customisation
32 |
33 | Siteify generates html files based on templates built into the app from the source
34 | [`Resources.swift`](siteify/Resouces.swift). Certain information about a file is patched
35 | in at the last minute using tags such as `\_\_ROOT\_\_`, `\_\_DATE\_\_`, `\_\_REPO\_\_`
36 | and, for individual source files , `\_\_CRDATE\_\_`, , `\_\_MDATE\_\_` along with the system
37 | `\_\_IMG\_\_` for that type of file. These templates are compiled into the application but
38 | can be overridden by placing your own HTML/CSS/JS templates in `~/Library/Siteify` for the
39 | styling you prefer.
40 |
41 | This project uses [ChimeHQ/SwiftLSPClient](https://github.com/ChimeHQ/SwiftLSPClient)
42 | under a `BSD 3-Clause "New" or "Revised" License"` to communicate with the
43 | [Apple LSP server](https://github.com/apple/sourcekit-lsp)
44 |
45 | ### MIT License
46 |
47 | Copyright (C) 2016 John Holdsworth
48 |
49 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
50 | documentation files (the "Software"), to deal in the Software without restriction, including without limitation
51 | the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
52 | and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
53 |
54 | The above copyright notice and this permission notice shall be included in all copies or substantial
55 | portions of the Software.
56 |
57 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
58 | LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
59 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
60 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
61 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
62 |
63 | This source includes a header file "sourcekit.h" from Apple's Swift Open Source distribution under Apache License v2.0 and a very old version of [canviz](http://www.ryandesign.com/canviz/) which allows you to render [graphviz](https://www.graphviz.org/) "dot" files of class inter-relationships if you have `/usr/local/bin/dot` installed and you view the generated files through a web server.
64 |
--------------------------------------------------------------------------------
/html/DataTransport.swift.html:
--------------------------------------------------------------------------------
1 |
= [WorkspaceFolder]?
65 |
--------------------------------------------------------------------------------
/html/canviz-0.1/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT-style software license for Canviz library
2 |
3 | Copyright (c) 2006-2009 Ryan Schmidt
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------
/html/canviz-0.1/README.txt:
--------------------------------------------------------------------------------
1 | CANVIZ
2 | ======
3 |
4 |
5 | Introduction
6 | ------------
7 |
8 | Canviz is a library for drawing Graphviz graphs to a web browser canvas. It is
9 | designed to be used by web applications that need to display or edit graphs, as
10 | a replacement for sending graphs as bitmapped images and image maps.
11 |
12 | For more information, please visit the Canviz web site at http://canviz.org/ .
13 |
14 |
15 | License
16 | -------
17 |
18 | Canviz is provided under the terms of the MIT license. See the file LICENSE.txt.
19 |
20 | This product includes color specifications and designs developed by Cynthia
21 | Brewer (http://colorbrewer.org/). Use of the ColorBrewer color schemes is
22 | subject to a separate license. See the file LICENSE-ColorBrewer.txt.
23 |
24 | Canviz requires the use of some other software, including the Path, Prototype
25 | and Excanvas libraries, and the Graphviz software, which have licenses of their
26 | own.
--------------------------------------------------------------------------------
/html/canviz-0.1/canviz.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of Canviz. See http://www.canviz.org/
3 | * $Id: //depot/siteify/siteify/Resources.swift#51 $
4 | */
5 |
6 | body {
7 | background: #eee;
8 | margin: 0;
9 | padding: 0;
10 | }
11 | #busy {
12 | position: fixed;
13 | z-index: 1;
14 | left: 50%;
15 | top: 50%;
16 | width: 10em;
17 | height: 2em;
18 | margin: -1em 0 0 -5em;
19 | line-height: 2em;
20 | text-align: center;
21 | background: #333;
22 | color: #fff;
23 | opacity: 0.95;
24 | }
25 | #graph_form {
26 | position: fixed;
27 | z-index: 2;
28 | left: 0;
29 | top: 0;
30 | background: #eee;
31 | border: solid #ccc;
32 | border-width: 0 1px 1px 0;
33 | opacity: 0.95;
34 | }
35 | #graph_form,
36 | #graph_form input,
37 | #graph_form select {
38 | font: 12px "Lucida Grande", Arial, Helvetica, sans-serif;
39 | }
40 | #graph_form fieldset {
41 | margin: 0.5em;
42 | padding: 0.5em 0;
43 | text-align: center;
44 | border: solid #ccc;
45 | border-width: 1px 0 0 0;
46 | }
47 | #graph_form legend {
48 | padding: 0 0.5em 0 0;
49 | }
50 | #graph_form input.little_button {
51 | width: 3em;
52 | }
53 | #graph_form select,
54 | #graph_form input.big_button {
55 | width: 15em;
56 | }
57 | #graph_container {
58 | background: #fff;
59 | margin: 0 auto;
60 | }
61 | #debug_output {
62 | margin: 1em;
63 | }
--------------------------------------------------------------------------------
/html/canviz.html:
--------------------------------------------------------------------------------
1 |
3 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | Siteify Object Graph
17 |
18 |
19 |
20 |
40 |
41 |
42 |