This repository was archived by the owner on Aug 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 237
Source hyperlinker #410
Merged
Merged
Source hyperlinker #410
Changes from all commits
Commits
Show all changes
109 commits
Select commit
Hold shift + click to select a range
ce0237f
Create scaffolding for Haskell source parser module.
panhania e17f625
Implement function for tagging parsed chunks with source spans.
panhania 413f7f3
Implement simple string chunking based on HsColour library.
panhania 6fb8d5a
Create basic token classification method.
panhania 57d4c9c
Adapt source span tagging to work with current whitespace handling.
panhania c7ecc59
Add record accessors to exports of hyperlinker parser module.
panhania 7b60788
Make parser module export all types and associated accessors.
panhania 5e904cb
Create simple HTML renderer for parsed source file.
panhania 1a43f35
Add support for specifying the CSS file path in HTML source renderer.
panhania 01a2e7c
Fix identifier recognition in Haskell source parser.
panhania ffd0e80
Fix comment recognition in Haskell source parser.
panhania e5bd5d3
Add support for recognizing compiler pragmas in source parser.
panhania d275f87
Create scaffolding of module for associating tokens with AST names.
panhania 74de002
Implement utility method for extracting variable identifiers from AST.
panhania d06a2b5
Create simple mechanism for associating tokens with AST names.
panhania cb3ece1
Add dummy support for hyperlinking named tokens.
panhania 7d43b8a
Fix span matcher bug causing wrong items being hyperlinked.
panhania 9a51a6d
Constrain elements exported by hyperlinker modules.
panhania 666af8d
Add support for type token recognition.
panhania 7065693
Add support for binding token recognition.
panhania 21984e4
Implement go-to-definition mechanism for local bindings.
panhania c84a3ef
Implement module export- and import-list item hyperlinking.
panhania fab61bb
Fix span matching to allow parenthesized operators hyperlinking.
panhania b31513d
Fix weird hyperlinking of parenthesized operators.
panhania 162b02e
Add support for type declaration anchors.
panhania c678689
Add support for top-level function declaration anchors.
panhania 1064953
Fix external anchors to contain HTML file extension.
panhania 60db149
Refactor the way AST names are handled within detailed tokens.
panhania a85224a
Implement hyperlinking of imported module names.
panhania ebd60c5
Fix parsing of single line comments with broken up newlines.
panhania a7888ae
Fix bug with improper newline handling.
panhania 45cc27f
Fix issues with escaped newlines in comments.
panhania 61942ce
Add support for parsing C preprocessor macros.
panhania 416c384
Add some documentation for parser module of source hyperlinker.
panhania 937a601
Add some documentation for AST module of source hyperlinker.
panhania ce4b560
Add command line option for generating hyperlinked source.
panhania 3eb96a6
Extend module interface with rich source token stream field.
panhania 4190a05
Implement source tokenization during interface creation process.
panhania 62d44cd
Create hyperlinker module and plug it into the Haddock pipeline.
panhania 6f16398
Add support for providing custom CSS files for hyperlinked source.
panhania a6bd86a
Add support for fancy highlighting upon hovering over identifier.
panhania affd889
Make source hyperlinker generate output in apropriate directory.
panhania 844c09d
Create module with hyperlinker utility functions.
panhania d58bcf2
Make external hyperlinks point to locations specified by source URLs.
panhania ab07020
Rewrite source generation to fixed links and directory structure.
panhania a6eb5a1
Add basic support for cross-package hyperlink generation.
panhania 98cb99c
Disable generating hyperlinks for module references.
panhania 4a6b6c1
Make Haddock generate source for all interfaces (also hidden ones).
panhania 311b3cc
Prevent source parser from throwing exception when lexing fails.
panhania 6cf5e45
Implement workaround for Chrome highlighting issues.
panhania 5a86381
Make hyperlinker generate correct anchors for data constructors.
panhania 46b1520
Make hyperlinker generate anchors for record field declarations.
panhania 671e7dc
Fix issue with hyperlink highlight styling in Chrome browser.
panhania d6cfd26
Add support for hyperlinking constructor names in patters.
panhania a1d3cb1
Add support for hyperlinking field names in record patterns.
panhania 7d26944
Add support for hyperlinking field names in record expressions.
panhania 6bebd57
Make hyperlinker respect pretty-printer flag and add documentation.
panhania fe22eda
Unexpose hyperlinker modules in Cabal configuration.
panhania d44fc5b
Setup HSpec framework for Haddock API package.
panhania f3d1f3c
Add basic tests related to comment parsing.
panhania 86ccbbf
Add tests related to parsing basic language constructs.
panhania 2426a64
Add simple tests for do-notation parsing.
panhania 5ddb425
Add very simple QuickCheck properties for source parser spec.
panhania 5f13457
Create simple test runner for hyperlinker tests.
panhania 3b6cbe3
Add test case for basic identifier hyperlinking.
panhania 15ac1a8
Add test case for operator hyperlinking.
panhania 95dfb7a
Add test case for constructor hyperlinking.
panhania 354d329
Add test case for record expressions and patterns hyperlinking.
panhania 9dfb3f8
Add test case for literal syntax highlighting.
panhania cddb709
Add hyperlinker test runner to .cabal and .gitignore files.
panhania beab75b
Adapt hyperlinker test runner to have the same interface as HTML one.
panhania 5da9073
Fix hyperlinker test runner file paths and add pretty-printing option.
panhania 40d0a05
Add reference files for hyperlinker test cases.
panhania 395a9c3
Make hyperlinker test runner strip local links from generated source.
panhania 7675698
Create simple script for accepting hyperlinker test case references.
panhania db51ad0
Re-accept hyperlinker test cases with local references stripped out.
panhania a229331
Fix bug with diffing wrong files in hyperlinker test runner.
panhania 4b0b4a8
Remove unused dependencies in Haddock API spec configuration.
panhania b91ee2f
Add support for hyperlinking synonyms in patterns.
panhania dc2eed5
Create test case for hyperlinking @-patterns.
panhania dd781d1
Add support for hyperlinking universally quantified type variables.
panhania 571944f
Create hyperlinker test case with quantified type variables.
panhania 2b748bb
Add scoped type variables test for polymorphism test case.
panhania d6fcd46
Add record wildcards test for records hyperlinking test case.
panhania 980664b
Document some functions in XHTML utlity module.
panhania 868248d
Make hyperlinker render qualified names as one entity.
panhania 8071c27
Add qualified name test for identifiers hyperlinking test case.
panhania 0d0550c
Fix crash happening when hyperlinking type family declarations.
panhania 5c01af0
Add support for anchoring data family constructor declarations.
panhania 28e93ce
Improve support for hyperlinking type families.
panhania 0ea2c4a
Add hyperlinker test case for checking type and type family declarati…
panhania aa6c6de
Fix issue with operators being recognized as preprocessor directives.
panhania 257e045
Fix broken tests for parsing and hyperlinking hash operators.
panhania d761512
Add support for anchoring signatures in type class declarations.
panhania ef3b869
Make hyperlinker generate anchors only to top-level value bindings.
panhania 29bb1ce
Create hyperlinker test case for type classes.
panhania 9c156cd
Update docs with information about source hyperlinking.
panhania 820381b
Update docs on using `--read-interface` option.
panhania a861470
Remove potentially dangerous record access in hyperlinker AST module.
panhania cab1191
Make Haddock generate warnings about potential misuse of hyperlinker.
panhania 861c45b
Fix incorrect specification of source style option in doc file.
panhania 99980dc
Refactor source path mapping to use modules as indices.
panhania 5927bfd
Fix bug where not all module interfaces were added to source mapping.
panhania fcaa46b
Extract main hyperlinker types to separate module.
panhania 1325460
Move source paths types to hyperlinker types module.
panhania bbd036a
Add support for hyperlinking modules in import lists.
panhania b6e9968
Add short documentation for hyperlinker source map type.
panhania 0e1cad7
Fix bug with module name being hyperlinked to `Prelude`.
panhania d76c57b
Fix problem with spec build in Haddock API configuration.
panhania File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
var highlight = function (on) { | ||
return function () { | ||
var links = document.getElementsByTagName('a'); | ||
for (var i = 0; i < links.length; i++) { | ||
var that = links[i]; | ||
|
||
if (this.href != that.href) { | ||
continue; | ||
} | ||
|
||
if (on) { | ||
that.classList.add("hover-highlight"); | ||
} else { | ||
that.classList.remove("hover-highlight"); | ||
} | ||
} | ||
} | ||
}; | ||
|
||
window.onload = function () { | ||
var links = document.getElementsByTagName('a'); | ||
for (var i = 0; i < links.length; i++) { | ||
links[i].onmouseover = highlight(true); | ||
links[i].onmouseout = highlight(false); | ||
} | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
body { | ||
background-color: #fdf6e3; | ||
} | ||
|
||
.hs-identifier { | ||
color: #073642; | ||
} | ||
|
||
.hs-identifier.hs-var { | ||
} | ||
|
||
.hs-identifier.hs-type { | ||
color: #5f5faf; | ||
} | ||
|
||
.hs-keyword { | ||
color: #af005f; | ||
} | ||
|
||
.hs-string, .hs-char { | ||
color: #cb4b16; | ||
} | ||
|
||
.hs-number { | ||
color: #268bd2; | ||
} | ||
|
||
.hs-operator { | ||
color: #d33682; | ||
} | ||
|
||
.hs-glyph, .hs-special { | ||
color: #dc322f; | ||
} | ||
|
||
.hs-comment { | ||
color: #8a8a8a; | ||
} | ||
|
||
.hs-pragma { | ||
color: #2aa198; | ||
} | ||
|
||
.hs-cpp { | ||
color: #859900; | ||
} | ||
|
||
a:link, a:visited { | ||
text-decoration: none; | ||
border-bottom: 1px solid #eee8d5; | ||
} | ||
|
||
a:hover, a.hover-highlight { | ||
background-color: #eee8d5; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think relaxing this upper bound would be good, perhaps to something like
7.10.*
. Unless we have a reason to believe that it won't work with 7.10.2, there's no need to constrain it this tightly. In all likelyhood, this will come out after 7.10.2 is released anyway.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just mindlessly copied it from the normal build dependencies. However, I don't think most of these are actually needed for spec so I can safely get rid of them.