-
Notifications
You must be signed in to change notification settings - Fork 101
Render source files #904
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
Closed
Closed
Render source files #904
Conversation
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 adds an opportunity delay a computation but also returns a more general result. Some refactoring to remove repeated prefixes.
We construct a shape as a query and it seems that the reducer is returning that shape instead of a shape with valid Uids.
The low level code is closer to the loader and xref2/Env provides a simpler interface. To go a step further, 'shape', 'ocaml_env' and 'uid_to_loc' should be removed from Lang.
Remove 'shape', 'ocaml_env' and 'uid_to_loc' from Lang and pass them to the resolver separately. These values are optional but must be passed all together and shouldn't be stored in .odoc files because they won't be used again. The typing environment is read when reading a .cmt. When loading a .cmti, the typing env is read from a .cmt with the same base pathname. When loading a .cmi, no attempt is made to load the typing env. If a .cmt was available, it would have been used instead.
The uid needed to lookup the location is queryied using shapes. The query is constructed by projecting an identifier on top of the "impl_shape". Using "Shape.local_reduce" because we don't need to lookup anything from other units.
"odoc compile" now triggers a warning when the implementation couldn't be found. Tests generally don't build any implementation so the warning happen a lot.
Locations of implementations and interfaces will be stored in every items in Lang. Currently only implements modules. Locations are initially empty and filled while compiling. The loader doesn't fill what it can yet. Co-authored-by: Guillaume Petiot <guillaume@tarides.com>
This module significantly slows down adding a field to type decl.
Locations are added to Lang similarly to modules.
Lookup_def is moved into a separate library to apply cppo.
The source code is intended to be used by the generator but the generator might be run from a context where the source code is gone. As an optimisation, looking up of locations is disabled when the source code is not given. Locations are only intended to be used to generate links to the source code. This has the nice side effect of removing the warning complaining that it didn't find a .cmt file, which would have to be disabled otherwise.
Signed-off-by: Paul-Elliot <peada@free.fr>
Moreover we changed location types: - they were relying on compiler-libs - they were including too much Signed-off-by: Paul-Elliot <peada@free.fr>
Added CSS, improved title, shortening code Signed-off-by: Paul-Elliot <peada@free.fr> Co-authored-by: Jules Aguillon <jules@j3s.fr>
Remove the secondary entry point in the generators for source code. Also, define a URL for source code. An alternative of this would be to represent the source code inside the document directly. The code pages would be defined by the 'document' library and the generators wouldn't need an extra entry point either. Formatting promoted to tests and small refactoring. Co-authored-by: Paul-Elliot <peada@free.fr>
Introduce a new type in the document, "Document", on top of "Page" that also allow to represent source pages. A new kind of url is needed for source pages, it might be useful later to represent link to source pages too. The HTML generator no longer need to create these urls. Co-authored-by: Paul-Elliot <peada@free.fr>
Lines anchor use the id "L<n>" where n is the line number Signed-off-by: Paul-Elliot <peada@free.fr> Co-authored-by: Jules Aguillon <jules@j3s.fr>
Signed-off-by: Paul-Elliot <peada@free.fr>
Which, is not working at the moment. The source files are discarded at the same time as the hidden compilation units, after expansion. Also, update Lang_desc and move source code related tests under a single directory.
Compilation unit of hidden modules are discarded just after the link step and the source code contained in them is lost. After linking, do a pass on the result to find modules aliases that have been expanded. Pair the source code of each discarded compilation unit with the new canonical identifier created during linking. The new identifier is used to generate the URL to the source code. For example, the source code for the module "Main__A" which is aliased to "A" in the module "Main" is placed in: Main/A/A.ml.html
I've re-opened this PR from a branch hosted on the main repository, to ease collaboration. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a WIP not ready for review.