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
[coqdoc] Fix #18516 (handling of Context) #18527
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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,5 @@ | ||
- **Fixed:** | ||
coqdoc links to section variables introduced with :cmd:`Context` | ||
(`#18527 <https://github.com/coq/coq/pull/18527>`_, | ||
fixes `#18516 <https://github.com/coq/coq/issues/18516>`_, | ||
by Pierre Roux). |
This file contains 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 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,36 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<link href="coqdoc.css" rel="stylesheet" type="text/css" /> | ||
<title>Coqdoc.Context</title> | ||
</head> | ||
|
||
<body> | ||
|
||
<div id="page"> | ||
|
||
<div id="header"> | ||
</div> | ||
|
||
<div id="main"> | ||
|
||
<h1 class="libtitle">Library Coqdoc.Context</h1> | ||
|
||
<div class="code"> | ||
<span class="id" title="keyword">Section</span> <a id="Sec" class="idref" href="#Sec"><span class="id" title="section">Sec</span></a>.<br/> | ||
<span class="id" title="keyword">Context</span> (<a id="Sec.foo" class="idref" href="#Sec.foo"><span class="id" title="binder, variable"><span id="foo:1" class="id">foo</span></span></a> : <a class="idref" href="http://coq.inria.fr/stdlib/Coq.Init.Datatypes.html#nat"><span class="id" title="inductive">nat</span></a>).<br/> | ||
<span class="id" title="keyword">Check</span> <a class="idref" href="Coqdoc.Context.html#Sec.foo"><span class="id" title="variable">foo</span></a>.<br/> | ||
<span class="id" title="keyword">End</span> <a class="idref" href="Coqdoc.Context.html#Sec"><span class="id" title="section">Sec</span></a>.<br/> | ||
</div> | ||
</div> | ||
|
||
<div id="footer"> | ||
<hr/><a href="index.html">Index</a><hr/>This page has been generated by <a href="http://coq.inria.fr/">coqdoc</a> | ||
</div> | ||
|
||
</div> | ||
|
||
</body> | ||
</html> |
This file contains 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,31 @@ | ||
\documentclass[12pt]{report} | ||
\usepackage[utf8x]{inputenc} | ||
|
||
%Warning: tipa declares many non-standard macros used by utf8x to | ||
%interpret utf8 characters but extra packages might have to be added | ||
%such as "textgreek" for Greek letters not already in tipa | ||
%or "stmaryrd" for mathematical symbols. | ||
%Utf8 codes missing a LaTeX interpretation can be defined by using | ||
%\DeclareUnicodeCharacter{code}{interpretation}. | ||
%Use coqdoc's option -p to add new packages or declarations. | ||
\usepackage{tipa} | ||
|
||
\usepackage[T1]{fontenc} | ||
\usepackage{fullpage} | ||
\usepackage{coqdoc} | ||
\usepackage{amsmath,amssymb} | ||
\usepackage{url} | ||
\begin{document} | ||
\coqlibrary{Coqdoc.Context}{Library }{Coqdoc.Context} | ||
|
||
\begin{coqdoccode} | ||
\coqdocnoindent | ||
\coqdockw{Section} \coqdef{Coqdoc.Context.Sec}{Sec}{\coqdocsection{Sec}}.\coqdoceol | ||
\coqdocnoindent | ||
\coqdockw{Context} (\coqdef{Coqdoc.Context.Sec.foo}{foo}{\coqdocvariable{foo}} : \coqexternalref{nat}{http://coq.inria.fr/stdlib/Coq.Init.Datatypes}{\coqdocinductive{nat}}).\coqdoceol | ||
\coqdocnoindent | ||
\coqdockw{Check} \coqref{Coqdoc.Context.Sec.foo}{\coqdocvariable{foo}}.\coqdoceol | ||
\coqdocnoindent | ||
\coqdockw{End} \coqref{Coqdoc.Context.Sec}{\coqdocsection{Sec}}.\coqdoceol | ||
\end{coqdoccode} | ||
\end{document} |
This file contains 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,4 @@ | ||
Section Sec. | ||
Context (foo : nat). | ||
Check foo. | ||
End Sec. |
This file contains 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.
Looking at it further, what is done for other declarations (in
vernacentries.ml
) is the following:Variable
/Hypothesis
: "var"Axiom
/Parameter
: "ax"Definition
/Theorem
: "def"Let
: "var"So, "def" would also be an option for
LocalDef
outside a section.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.
Makes sense but I'd rather keep it as "var" for now since the references (lines starting with
R
in the glob file) mention it as such.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'm now confused. Shouldn't
Context (a:=0)
outside a section be considered the same asDefinition a:=0
(and thus with "def") or are we rather talking aboutLet
?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.
You're right, I did forgot that outside-section case. Should be fixed.
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.
Did you push?
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.
My bad, here it is.