From c54f3dae20a3d39154717f67df6a90ffa008d47e Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Thu, 16 Jun 2016 11:14:45 +0100 Subject: [PATCH 01/15] Create human readable logs module on top of LatexLogParser; use it in the PDF controller. --- .../ide/human-readable-logs/HumanReadableLogs.coffee | 6 ++++++ .../coffee/ide/pdf/controllers/PdfController.coffee | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee diff --git a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee new file mode 100644 index 0000000000..ad3c27a505 --- /dev/null +++ b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee @@ -0,0 +1,6 @@ +define [ + "libs/latex-log-parser" +], (LogParser) -> + parse : (rawLog, options) -> + parsedLogEntries = LogParser.parse(rawLog, options) + return parsedLogEntries diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 4baa2a22ff..ed1dee8da2 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -1,9 +1,9 @@ define [ "base" "ace/ace" - "libs/latex-log-parser" + "ide/human-readable-logs/HumanReadableLogs" "libs/bib-log-parser" -], (App, Ace, LogParser, BibLogParser) -> +], (App, Ace, HumanReadableLogs, BibLogParser) -> App.controller "PdfController", ($scope, $http, ide, $modal, synctex, event_tracking, localStorage) -> # enable per-user containers if querystring includes isolated=true @@ -162,11 +162,11 @@ define [ accumulateResults = (newEntries) -> for key in ['all', 'errors', 'warnings'] logEntries[key] = logEntries[key].concat newEntries[key] - + # use the parsers for each file type processLog = (log) -> $scope.pdf.rawLog = log - {errors, warnings, typesetting} = LogParser.parse(log, ignoreDuplicates: true) + {errors, warnings, typesetting} = HumanReadableLogs.parse(log, ignoreDuplicates: true) all = [].concat errors, warnings, typesetting accumulateResults {all, errors, warnings} From f167aacc0819483ef6aec5fec44c60898efc2a7c Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Thu, 16 Jun 2016 15:29:00 +0100 Subject: [PATCH 02/15] Add sample rules file. --- .../HumanReadableLogs.coffee | 6 +- .../HumanReadableLogsRules.coffee | 102 ++++++++++++++++++ 2 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee diff --git a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee index ad3c27a505..2c54168812 100644 --- a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee +++ b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee @@ -1,6 +1,10 @@ define [ "libs/latex-log-parser" -], (LogParser) -> + "ide/human-readable-logs/HumanReadableLogsRules" +], (LogParser, ruleset) -> parse : (rawLog, options) -> parsedLogEntries = LogParser.parse(rawLog, options) + + console.log entry.message for entry in parsedLogEntries.all + return parsedLogEntries diff --git a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee new file mode 100644 index 0000000000..a33a0a7ed0 --- /dev/null +++ b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee @@ -0,0 +1,102 @@ +define -> [ + regExToMatch: /Too many }'s/ + humanReadableLogText: "The reason LaTeX thinks there are too many }'s + here is that the opening curly brace is missing after the \\date control + sequence and before the word December, so the closing curly brace is + seen as one too many (which it is!). In fact, there are other things + which can follow the \\date command apart from a date in curly braces, + so LaTeX cannot possibly guess that you've missed out the opening curly + brace until it finds a closing one!" + , + regExToMatch: /Undefined control sequence/ + humanReadableLogText: "In this example, LaTeX is complaining that it has + no such command (\"control sequence\") as \\dtae. Obviously it's been + mistyped, but only a human can detect that fact: all LaTeX knows is that + \\dtae is not a command it knows about: it's undefined. Mistypings are + the most common source of errors. Some editors allow common commands and + environments to be inserted using drop-down menus or icons, which may + be used to avoid these errors." + , + regExToMatch: /Missing \$ inserted/ + humanReadableLogText: "A character that can only be used in the + mathematics was inserted in normal text. If you intended to use + mathematics mode, then use $...$ or \\begin{math}...\\end{math} or use + the 'quick math mode': \ensuremath{...}. If you did not intend to use + mathematics mode, then perhaps you are trying to use a special character + that needs to be entered in a different way; for example _ will be + interpreted as a subscript operator in mathematics mode, and you need + \\_ to get an underscore character. + + This can also happen if you use the wrong character encoding, for + example using utf8 without \"\\usepackage[utf8]{inputenc}\" or using + iso8859-1 without \"\\usepackage[latin1]{inputenc}\", there are several + character encoding formats, make sure to pick the right one." + , + regExToMatch: /Runaway argument/ + humanReadableLogText: "In this error, the closing curly brace has been + omitted from the date. It's the opposite of the error of too many }'s, + and it results in \\maketitle trying to format the title page while + LaTeX is still expecting more text for the date! As \\maketitle creates + new paragraphs on the title page, this is detected and LaTeX complains + that the previous paragraph has ended but \\date is not yet finished." + , + regExToMatch: /Underfull \\hbox/ + humanReadableLogText: "This is a warning that LaTeX cannot stretch the + line wide enough to fit, without making the spacing bigger than its + currently permitted maximum. The badness (0-10,000) indicates how severe + this is (here you can probably ignore a badness of 1394). It says what + lines of your file it was typesetting when it found this, and the number + in square brackets is the number of the page onto which the offending + line was printed. The codes separated by slashes are the typeface and + font style and size used in the line. Ignore them for the moment. + + This comes up if you force a linebreak, e.g., \\\\, and have a return + before it. Normally TeX ignores linebreaks, providing full paragraphs to + ragged text. In this case it is necessary to pull the linebreak up one + line to the end of the previous sentence. + + This warning may also appear when inserting images. It can be avoided by + using the \\textwidth or possibly \\linewidth options, e.g. + \\includegraphics[width=\\textwidth]{image_name}" + , + regExToMatch: /Overfull \\hbox/ + humanReadableLogText: "An overfull \hbox means that there is a + hyphenation or justification problem: moving the last word on the line + to the next line would make the spaces in the line wider than the + current limit; keeping the word on the line would make the spaces + smaller than the current limit, so the word is left on the line, but + with the minimum allowed space between words, and which makes the line + go over the edge. + + The warning is given so that you can find the line in the code that + originates the problem (in this case: 860-861) and fix it. The line on + this example is too long by a shade over 9pt. The chosen hyphenation + point which minimizes the error is shown at the end of the line (Win-). + Line numbers and page numbers are given as before. In this case, 9pt is + too much to ignore (over 3mm), and a manual correction needs making + (such as a change to the hyphenation), or the flexibility settings need + changing. + + If the \"overfull\" word includes a forward slash, such as + \"input/output\", this should be properly typeset as \"input\\slash + output\". The use of \\slash has the same effect as using the \"/\" + character, except that it can form the end of a line (with the following + words appearing at the start of the next line). The \"/\" character is + typically used in units, such as \"mm/year\" character, which should not + be broken over multiple lines. + + The warning can also be issued when the \\end{document} tag was not + included or was deleted." + , + regExToMatch: /LaTeX Error: File .* not found/ + humanReadableLogText: "When you use the \\usepackage command to request + LaTeX to use a certain package, it will look for a file with the + specified name and the filetype .sty. In this case the user has mistyped + the name of the paralist package, so it's easy to fix. However, if you + get the name right, but the package is not installed on your machine, + you will need to download and install it before continuing. If you don't + want to affect the global installation of the machine, you can simply + download from Internet the necessary .sty file and put it in the same + folder of the document you are compiling." +] + From 9b8d695e439c7878b89e1ca8412988209283f0bd Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Thu, 16 Jun 2016 15:53:39 +0100 Subject: [PATCH 03/15] Match logs against ruleset; show human readable message when appropriate. --- .../web/app/views/project/editor/pdf.jade | 3 +- .../HumanReadableLogs.coffee | 7 ++++- .../HumanReadableLogsRules.coffee | 28 +++++++++---------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index ce5bd16b53..1cdab7a2b2 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -105,7 +105,8 @@ div.full-size.pdf(ng-controller="PdfController") span(ng-show="entry.file") {{ entry.file }} span(ng-show="entry.line") , line {{ entry.line }} p.entry-message(ng-show="entry.message") {{ entry.message }} - p.entry-content(ng-show="entry.content") {{ entry.content }} + p.entry-content(ng-show="entry.humanReadableMessage") {{ entry.humanReadableMessage }} + p.entry-content(ng-show="entry.content && !entry.humanReadableMessage") {{ entry.content }} p .pull-right diff --git a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee index 2c54168812..3109db2669 100644 --- a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee +++ b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee @@ -5,6 +5,11 @@ define [ parse : (rawLog, options) -> parsedLogEntries = LogParser.parse(rawLog, options) - console.log entry.message for entry in parsedLogEntries.all + _getHumanReadableMessage = (logMessage) -> + return rule.humanReadableMessage for rule in ruleset when rule.regexToMatch.test logMessage + + for entry in parsedLogEntries.all + humanReadableMessage = _getHumanReadableMessage entry.message + entry.humanReadableMessage = humanReadableMessage if humanReadableMessage? return parsedLogEntries diff --git a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee index a33a0a7ed0..58ffa9bb75 100644 --- a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee +++ b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee @@ -1,6 +1,6 @@ define -> [ - regExToMatch: /Too many }'s/ - humanReadableLogText: "The reason LaTeX thinks there are too many }'s + regexToMatch: /Too many }'s/ + humanReadableMessage: "The reason LaTeX thinks there are too many }'s here is that the opening curly brace is missing after the \\date control sequence and before the word December, so the closing curly brace is seen as one too many (which it is!). In fact, there are other things @@ -8,8 +8,8 @@ define -> [ so LaTeX cannot possibly guess that you've missed out the opening curly brace until it finds a closing one!" , - regExToMatch: /Undefined control sequence/ - humanReadableLogText: "In this example, LaTeX is complaining that it has + regexToMatch: /Undefined control sequence/ + humanReadableMessage: "In this example, LaTeX is complaining that it has no such command (\"control sequence\") as \\dtae. Obviously it's been mistyped, but only a human can detect that fact: all LaTeX knows is that \\dtae is not a command it knows about: it's undefined. Mistypings are @@ -17,8 +17,8 @@ define -> [ environments to be inserted using drop-down menus or icons, which may be used to avoid these errors." , - regExToMatch: /Missing \$ inserted/ - humanReadableLogText: "A character that can only be used in the + regexToMatch: /Missing \$ inserted/ + humanReadableMessage: "A character that can only be used in the mathematics was inserted in normal text. If you intended to use mathematics mode, then use $...$ or \\begin{math}...\\end{math} or use the 'quick math mode': \ensuremath{...}. If you did not intend to use @@ -32,16 +32,16 @@ define -> [ iso8859-1 without \"\\usepackage[latin1]{inputenc}\", there are several character encoding formats, make sure to pick the right one." , - regExToMatch: /Runaway argument/ - humanReadableLogText: "In this error, the closing curly brace has been + regexToMatch: /Runaway argument/ + humanReadableMessage: "In this error, the closing curly brace has been omitted from the date. It's the opposite of the error of too many }'s, and it results in \\maketitle trying to format the title page while LaTeX is still expecting more text for the date! As \\maketitle creates new paragraphs on the title page, this is detected and LaTeX complains that the previous paragraph has ended but \\date is not yet finished." , - regExToMatch: /Underfull \\hbox/ - humanReadableLogText: "This is a warning that LaTeX cannot stretch the + regexToMatch: /Underfull \\hbox/ + humanReadableMessage: "This is a warning that LaTeX cannot stretch the line wide enough to fit, without making the spacing bigger than its currently permitted maximum. The badness (0-10,000) indicates how severe this is (here you can probably ignore a badness of 1394). It says what @@ -59,8 +59,8 @@ define -> [ using the \\textwidth or possibly \\linewidth options, e.g. \\includegraphics[width=\\textwidth]{image_name}" , - regExToMatch: /Overfull \\hbox/ - humanReadableLogText: "An overfull \hbox means that there is a + regexToMatch: /Overfull \\hbox/ + humanReadableMessage: "An overfull \hbox means that there is a hyphenation or justification problem: moving the last word on the line to the next line would make the spaces in the line wider than the current limit; keeping the word on the line would make the spaces @@ -88,8 +88,8 @@ define -> [ The warning can also be issued when the \\end{document} tag was not included or was deleted." , - regExToMatch: /LaTeX Error: File .* not found/ - humanReadableLogText: "When you use the \\usepackage command to request + regexToMatch: /LaTeX Error: File .* not found/ + humanReadableMessage: "When you use the \\usepackage command to request LaTeX to use a certain package, it will look for a file with the specified name and the filetype .sty. In this case the user has mistyped the name of the paralist package, so it's easy to fix. However, if you From 40fda6e3618c2e31096021a5262596d3471332be Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Thu, 16 Jun 2016 16:29:19 +0100 Subject: [PATCH 04/15] Support HTML in human readable log messages. --- .../web/app/views/project/editor/pdf.jade | 2 +- .../HumanReadableLogsRules.coffee | 116 +++++------------- 2 files changed, 29 insertions(+), 89 deletions(-) diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index 1cdab7a2b2..a97a4c5835 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -105,7 +105,7 @@ div.full-size.pdf(ng-controller="PdfController") span(ng-show="entry.file") {{ entry.file }} span(ng-show="entry.line") , line {{ entry.line }} p.entry-message(ng-show="entry.message") {{ entry.message }} - p.entry-content(ng-show="entry.humanReadableMessage") {{ entry.humanReadableMessage }} + p.entry-content(ng-show="entry.humanReadableMessage", ng-bind-html="entry.humanReadableMessage") p.entry-content(ng-show="entry.content && !entry.humanReadableMessage") {{ entry.content }} p diff --git a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee index 58ffa9bb75..87b6e33895 100644 --- a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee +++ b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee @@ -1,102 +1,42 @@ define -> [ regexToMatch: /Too many }'s/ - humanReadableMessage: "The reason LaTeX thinks there are too many }'s - here is that the opening curly brace is missing after the \\date control - sequence and before the word December, so the closing curly brace is - seen as one too many (which it is!). In fact, there are other things - which can follow the \\date command apart from a date in curly braces, - so LaTeX cannot possibly guess that you've missed out the opening curly - brace until it finds a closing one!" + humanReadableMessage: """ +

The reason LaTeX thinks there are too many }'s here is that the opening curly brace is missing after the \date control sequence and before the word December, so the closing curly brace is seen as one too many (which it is!). In fact, there are other things which can follow the \date command apart from a date in curly braces, so LaTeX cannot possibly guess that you've missed out the opening curly brace until it finds a closing one!

+ """ , regexToMatch: /Undefined control sequence/ - humanReadableMessage: "In this example, LaTeX is complaining that it has - no such command (\"control sequence\") as \\dtae. Obviously it's been - mistyped, but only a human can detect that fact: all LaTeX knows is that - \\dtae is not a command it knows about: it's undefined. Mistypings are - the most common source of errors. Some editors allow common commands and - environments to be inserted using drop-down menus or icons, which may - be used to avoid these errors." + humanReadableMessage: """ +

In this example, LaTeX is complaining that it has no such command ("control sequence") as \dtae. Obviously it's been mistyped, but only a human can detect that fact: all LaTeX knows is that \dtae is not a command it knows about: it's undefined. Mistypings are the most common source of errors. Some editors allow common commands and environments to be inserted using drop-down menus or icons, which may be used to avoid these errors.

+ """ , regexToMatch: /Missing \$ inserted/ - humanReadableMessage: "A character that can only be used in the - mathematics was inserted in normal text. If you intended to use - mathematics mode, then use $...$ or \\begin{math}...\\end{math} or use - the 'quick math mode': \ensuremath{...}. If you did not intend to use - mathematics mode, then perhaps you are trying to use a special character - that needs to be entered in a different way; for example _ will be - interpreted as a subscript operator in mathematics mode, and you need - \\_ to get an underscore character. - - This can also happen if you use the wrong character encoding, for - example using utf8 without \"\\usepackage[utf8]{inputenc}\" or using - iso8859-1 without \"\\usepackage[latin1]{inputenc}\", there are several - character encoding formats, make sure to pick the right one." + humanReadableMessage: """ +

A character that can only be used in the mathematics was inserted in normal text. If you intended to use mathematics mode, then use $...$ or \begin{math}...\end{math} or use the 'quick math mode': \ensuremath{...}. If you did not intend to use mathematics mode, then perhaps you are trying to use a special character that needs to be entered in a different way; for example _ will be interpreted as a subscript operator in mathematics mode, and you need \_ to get an underscore character.

+

This can also happen if you use the wrong character encoding, for example using utf8 without "\\usepackage[utf8]{inputenc}" or using iso8859-1 without "\\usepackage[latin1]{inputenc}", there are several character encoding formats, make sure to pick the right one.

+ """ , regexToMatch: /Runaway argument/ - humanReadableMessage: "In this error, the closing curly brace has been - omitted from the date. It's the opposite of the error of too many }'s, - and it results in \\maketitle trying to format the title page while - LaTeX is still expecting more text for the date! As \\maketitle creates - new paragraphs on the title page, this is detected and LaTeX complains - that the previous paragraph has ended but \\date is not yet finished." + humanReadableMessage: """ +

In this error, the closing curly brace has been omitted from the date. It's the opposite of the error of too many }'s, and it results in \maketitle trying to format the title page while LaTeX is still expecting more text for the date! As \maketitle creates new paragraphs on the title page, this is detected and LaTeX complains that the previous paragraph has ended but \date is not yet finished.

+ """ , regexToMatch: /Underfull \\hbox/ - humanReadableMessage: "This is a warning that LaTeX cannot stretch the - line wide enough to fit, without making the spacing bigger than its - currently permitted maximum. The badness (0-10,000) indicates how severe - this is (here you can probably ignore a badness of 1394). It says what - lines of your file it was typesetting when it found this, and the number - in square brackets is the number of the page onto which the offending - line was printed. The codes separated by slashes are the typeface and - font style and size used in the line. Ignore them for the moment. - - This comes up if you force a linebreak, e.g., \\\\, and have a return - before it. Normally TeX ignores linebreaks, providing full paragraphs to - ragged text. In this case it is necessary to pull the linebreak up one - line to the end of the previous sentence. - - This warning may also appear when inserting images. It can be avoided by - using the \\textwidth or possibly \\linewidth options, e.g. - \\includegraphics[width=\\textwidth]{image_name}" + humanReadableMessage: """ +

This is a warning that LaTeX cannot stretch the line wide enough to fit, without making the spacing bigger than its currently permitted maximum. The badness (0-10,000) indicates how severe this is (here you can probably ignore a badness of 1394). It says what lines of your file it was typesetting when it found this, and the number in square brackets is the number of the page onto which the offending line was printed. The codes separated by slashes are the typeface and font style and size used in the line. Ignore them for the moment.

+

This comes up if you force a linebreak, e.g., \\, and have a return before it. Normally TeX ignores linebreaks, providing full paragraphs to ragged text. In this case it is necessary to pull the linebreak up one line to the end of the previous sentence.

+

This warning may also appear when inserting images. It can be avoided by using the \textwidth or possibly \linewidth options, e.g. \includegraphics[width=\textwidth]{image_name}

+ """ , regexToMatch: /Overfull \\hbox/ - humanReadableMessage: "An overfull \hbox means that there is a - hyphenation or justification problem: moving the last word on the line - to the next line would make the spaces in the line wider than the - current limit; keeping the word on the line would make the spaces - smaller than the current limit, so the word is left on the line, but - with the minimum allowed space between words, and which makes the line - go over the edge. - - The warning is given so that you can find the line in the code that - originates the problem (in this case: 860-861) and fix it. The line on - this example is too long by a shade over 9pt. The chosen hyphenation - point which minimizes the error is shown at the end of the line (Win-). - Line numbers and page numbers are given as before. In this case, 9pt is - too much to ignore (over 3mm), and a manual correction needs making - (such as a change to the hyphenation), or the flexibility settings need - changing. - - If the \"overfull\" word includes a forward slash, such as - \"input/output\", this should be properly typeset as \"input\\slash - output\". The use of \\slash has the same effect as using the \"/\" - character, except that it can form the end of a line (with the following - words appearing at the start of the next line). The \"/\" character is - typically used in units, such as \"mm/year\" character, which should not - be broken over multiple lines. - - The warning can also be issued when the \\end{document} tag was not - included or was deleted." + humanReadableMessage: """ +

An overfull \hbox means that there is a hyphenation or justification problem: moving the last word on the line to the next line would make the spaces in the line wider than the current limit; keeping the word on the line would make the spaces smaller than the current limit, so the word is left on the line, but with the minimum allowed space between words, and which makes the line go over the edge.

+

The warning is given so that you can find the line in the code that originates the problem (in this case: 860-861) and fix it. The line on this example is too long by a shade over 9pt. The chosen hyphenation point which minimizes the error is shown at the end of the line (Win-). Line numbers and page numbers are given as before. In this case, 9pt is too much to ignore (over 3mm), and a manual correction needs making (such as a change to the hyphenation), or the flexibility settings need changing.

+

If the "overfull" word includes a forward slash, such as "input/output", this should be properly typeset as "input\slash output". The use of \slash has the same effect as using the "/" character, except that it can form the end of a line (with the following words appearing at the start of the next line). The "/" character is typically used in units, such as "mm/year" character, which should not be broken over multiple lines.

+

The warning can also be issued when the \end{document} tag was not included or was deleted.

+ """ , regexToMatch: /LaTeX Error: File .* not found/ - humanReadableMessage: "When you use the \\usepackage command to request - LaTeX to use a certain package, it will look for a file with the - specified name and the filetype .sty. In this case the user has mistyped - the name of the paralist package, so it's easy to fix. However, if you - get the name right, but the package is not installed on your machine, - you will need to download and install it before continuing. If you don't - want to affect the global installation of the machine, you can simply - download from Internet the necessary .sty file and put it in the same - folder of the document you are compiling." -] - + humanReadableMessage: """ +

When you use the \\usepackage command to request LaTeX to use a certain package, it will look for a file with the specified name and the filetype .sty. In this case the user has mistyped the name of the paralist package, so it's easy to fix. However, if you get the name right, but the package is not installed on your machine, you will need to download and install it before continuing. If you don't want to affect the global installation of the machine, you can simply download from Internet the necessary .sty file and put it in the same folder of the document you are compiling.

+ """ +] \ No newline at end of file From 54d48ce0eaea42fef99e56a904a9c61c253ed7d4 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Fri, 17 Jun 2016 11:42:32 +0100 Subject: [PATCH 05/15] Support extra info URL in human readable hints. --- .../web/app/views/project/editor/pdf.jade | 7 +++- .../HumanReadableLogs.coffee | 9 +++-- .../HumanReadableLogsRules.coffee | 39 +++++++++++-------- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index a97a4c5835..f1d2e232c5 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -105,8 +105,11 @@ div.full-size.pdf(ng-controller="PdfController") span(ng-show="entry.file") {{ entry.file }} span(ng-show="entry.line") , line {{ entry.line }} p.entry-message(ng-show="entry.message") {{ entry.message }} - p.entry-content(ng-show="entry.humanReadableMessage", ng-bind-html="entry.humanReadableMessage") - p.entry-content(ng-show="entry.content && !entry.humanReadableMessage") {{ entry.content }} + div + i.fa.fa-hand-o-right(aria-hidden="true") + p.entry-content(ng-show="entry.humanReadableHint", ng-bind-html="entry.humanReadableHint") + a(ng-href="{{ entry.extraInfoURL }}", target="_blank") #{translate("log_entry_extra_info")} + p.entry-content(ng-show="entry.content") {{ entry.content }} p .pull-right diff --git a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee index 3109db2669..5f4627cb95 100644 --- a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee +++ b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee @@ -5,11 +5,12 @@ define [ parse : (rawLog, options) -> parsedLogEntries = LogParser.parse(rawLog, options) - _getHumanReadableMessage = (logMessage) -> - return rule.humanReadableMessage for rule in ruleset when rule.regexToMatch.test logMessage + _getRule = (logMessage) -> + return rule for rule in ruleset when rule.regexToMatch.test logMessage for entry in parsedLogEntries.all - humanReadableMessage = _getHumanReadableMessage entry.message - entry.humanReadableMessage = humanReadableMessage if humanReadableMessage? + { humanReadableHint, extraInfoURL } = _getRule entry.message + entry.humanReadableHint = humanReadableHint if humanReadableHint? + entry.extraInfoURL = extraInfoURL if extraInfoURL? return parsedLogEntries diff --git a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee index 87b6e33895..b0121b6c61 100644 --- a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee +++ b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee @@ -1,42 +1,49 @@ define -> [ regexToMatch: /Too many }'s/ - humanReadableMessage: """ -

The reason LaTeX thinks there are too many }'s here is that the opening curly brace is missing after the \date control sequence and before the word December, so the closing curly brace is seen as one too many (which it is!). In fact, there are other things which can follow the \date command apart from a date in curly braces, so LaTeX cannot possibly guess that you've missed out the opening curly brace until it finds a closing one!

+ extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Too_many_.7D.27s" + humanReadableHint: """ +

The reason LaTeX thinks there are too many }'s here is that the opening curly brace is missing after the \\date control sequence and before the word December, so the closing curly brace is seen as one too many (which it is!). In fact, there are other things which can follow the \\date command apart from a date in curly braces, so LaTeX cannot possibly guess that you've missed out the opening curly brace until it finds a closing one!

""" , regexToMatch: /Undefined control sequence/ - humanReadableMessage: """ -

In this example, LaTeX is complaining that it has no such command ("control sequence") as \dtae. Obviously it's been mistyped, but only a human can detect that fact: all LaTeX knows is that \dtae is not a command it knows about: it's undefined. Mistypings are the most common source of errors. Some editors allow common commands and environments to be inserted using drop-down menus or icons, which may be used to avoid these errors.

+ extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Undefined_control_sequence" + humanReadableHint: """ +

In this example, LaTeX is complaining that it has no such command ("control sequence") as \\dtae. Obviously it's been mistyped, but only a human can detect that fact: all LaTeX knows is that \\dtae is not a command it knows about: it's undefined. Mistypings are the most common source of errors. Some editors allow common commands and environments to be inserted using drop-down menus or icons, which may be used to avoid these errors.

""" , regexToMatch: /Missing \$ inserted/ - humanReadableMessage: """ -

A character that can only be used in the mathematics was inserted in normal text. If you intended to use mathematics mode, then use $...$ or \begin{math}...\end{math} or use the 'quick math mode': \ensuremath{...}. If you did not intend to use mathematics mode, then perhaps you are trying to use a special character that needs to be entered in a different way; for example _ will be interpreted as a subscript operator in mathematics mode, and you need \_ to get an underscore character.

+ extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Not_in_Mathematics_Mode" + humanReadableHint: """ +

A character that can only be used in the mathematics was inserted in normal text. If you intended to use mathematics mode, then use $...$ or \\begin{math}...\\end{math} or use the 'quick math mode': \\ensuremath{...}. If you did not intend to use mathematics mode, then perhaps you are trying to use a special character that needs to be entered in a different way; for example _ will be interpreted as a subscript operator in mathematics mode, and you need \\_ to get an underscore character.

This can also happen if you use the wrong character encoding, for example using utf8 without "\\usepackage[utf8]{inputenc}" or using iso8859-1 without "\\usepackage[latin1]{inputenc}", there are several character encoding formats, make sure to pick the right one.

""" , regexToMatch: /Runaway argument/ - humanReadableMessage: """ -

In this error, the closing curly brace has been omitted from the date. It's the opposite of the error of too many }'s, and it results in \maketitle trying to format the title page while LaTeX is still expecting more text for the date! As \maketitle creates new paragraphs on the title page, this is detected and LaTeX complains that the previous paragraph has ended but \date is not yet finished.

+ extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Runaway_argument" + humanReadableHint: """ +

In this error, the closing curly brace has been omitted from the date. It's the opposite of the error of too many }'s, and it results in \\maketitle trying to format the title page while LaTeX is still expecting more text for the date! As \\maketitle creates new paragraphs on the title page, this is detected and LaTeX complains that the previous paragraph has ended but \\date is not yet finished.

""" , regexToMatch: /Underfull \\hbox/ - humanReadableMessage: """ + extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Underfull_hbox" + humanReadableHint: """

This is a warning that LaTeX cannot stretch the line wide enough to fit, without making the spacing bigger than its currently permitted maximum. The badness (0-10,000) indicates how severe this is (here you can probably ignore a badness of 1394). It says what lines of your file it was typesetting when it found this, and the number in square brackets is the number of the page onto which the offending line was printed. The codes separated by slashes are the typeface and font style and size used in the line. Ignore them for the moment.

-

This comes up if you force a linebreak, e.g., \\, and have a return before it. Normally TeX ignores linebreaks, providing full paragraphs to ragged text. In this case it is necessary to pull the linebreak up one line to the end of the previous sentence.

-

This warning may also appear when inserting images. It can be avoided by using the \textwidth or possibly \linewidth options, e.g. \includegraphics[width=\textwidth]{image_name}

+

This comes up if you force a linebreak, e.g., \\\\, and have a return before it. Normally TeX ignores linebreaks, providing full paragraphs to ragged text. In this case it is necessary to pull the linebreak up one line to the end of the previous sentence.

+

This warning may also appear when inserting images. It can be avoided by using the \\textwidth or possibly \\linewidth options, e.g. \\includegraphics[width=\\textwidth]{image_name}

""" , regexToMatch: /Overfull \\hbox/ - humanReadableMessage: """ -

An overfull \hbox means that there is a hyphenation or justification problem: moving the last word on the line to the next line would make the spaces in the line wider than the current limit; keeping the word on the line would make the spaces smaller than the current limit, so the word is left on the line, but with the minimum allowed space between words, and which makes the line go over the edge.

+ extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Overfull_hbox" + humanReadableHint: """ +

An overfull \\hbox means that there is a hyphenation or justification problem: moving the last word on the line to the next line would make the spaces in the line wider than the current limit; keeping the word on the line would make the spaces smaller than the current limit, so the word is left on the line, but with the minimum allowed space between words, and which makes the line go over the edge.

The warning is given so that you can find the line in the code that originates the problem (in this case: 860-861) and fix it. The line on this example is too long by a shade over 9pt. The chosen hyphenation point which minimizes the error is shown at the end of the line (Win-). Line numbers and page numbers are given as before. In this case, 9pt is too much to ignore (over 3mm), and a manual correction needs making (such as a change to the hyphenation), or the flexibility settings need changing.

-

If the "overfull" word includes a forward slash, such as "input/output", this should be properly typeset as "input\slash output". The use of \slash has the same effect as using the "/" character, except that it can form the end of a line (with the following words appearing at the start of the next line). The "/" character is typically used in units, such as "mm/year" character, which should not be broken over multiple lines.

-

The warning can also be issued when the \end{document} tag was not included or was deleted.

+

If the "overfull" word includes a forward slash, such as "input/output", this should be properly typeset as "input\\slash output". The use of \\slash has the same effect as using the "/" character, except that it can form the end of a line (with the following words appearing at the start of the next line). The "/" character is typically used in units, such as "mm/year" character, which should not be broken over multiple lines.

+

The warning can also be issued when the \\end{document} tag was not included or was deleted.

""" , regexToMatch: /LaTeX Error: File .* not found/ - humanReadableMessage: """ + extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Missing_package" + humanReadableHint: """

When you use the \\usepackage command to request LaTeX to use a certain package, it will look for a file with the specified name and the filetype .sty. In this case the user has mistyped the name of the paralist package, so it's easy to fix. However, if you get the name right, but the package is not installed on your machine, you will need to download and install it before continuing. If you don't want to affect the global installation of the machine, you can simply download from Internet the necessary .sty file and put it in the same folder of the document you are compiling.

""" ] \ No newline at end of file From 2bfe0d0ba9659903d565734f3b057f89fdc68453 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Fri, 17 Jun 2016 14:16:38 +0100 Subject: [PATCH 06/15] Basic mark-up for hint card. --- services/web/app/views/project/editor/pdf.jade | 5 +++-- services/web/public/stylesheets/app/editor/pdf.less | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index f1d2e232c5..79b328eada 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -105,8 +105,9 @@ div.full-size.pdf(ng-controller="PdfController") span(ng-show="entry.file") {{ entry.file }} span(ng-show="entry.line") , line {{ entry.line }} p.entry-message(ng-show="entry.message") {{ entry.message }} - div - i.fa.fa-hand-o-right(aria-hidden="true") + .card.card-hint + figure.card-hint-icon-container + i.fa.fa-lightbulb-o(aria-hidden="true") p.entry-content(ng-show="entry.humanReadableHint", ng-bind-html="entry.humanReadableHint") a(ng-href="{{ entry.extraInfoURL }}", target="_blank") #{translate("log_entry_extra_info")} p.entry-content(ng-show="entry.content") {{ entry.content }} diff --git a/services/web/public/stylesheets/app/editor/pdf.less b/services/web/public/stylesheets/app/editor/pdf.less index 6e813d5eaf..b9b71cc268 100644 --- a/services/web/public/stylesheets/app/editor/pdf.less +++ b/services/web/public/stylesheets/app/editor/pdf.less @@ -177,4 +177,8 @@ .keyboard-shortcut { white-space: nowrap; +} + +.card-hint:extend(.card-thin) { + margin-top: 10px; } \ No newline at end of file From 605bb07ba3414d6963f9b5c5c7098fe56e54c779 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 20 Jun 2016 09:45:14 +0100 Subject: [PATCH 07/15] Hint card styling. --- .../web/app/views/project/editor/pdf.jade | 7 +++-- .../HumanReadableLogsRules.coffee | 20 +++++--------- .../public/stylesheets/app/editor/pdf.less | 27 +++++++++++++++++++ 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index 79b328eada..63add3e559 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -108,8 +108,11 @@ div.full-size.pdf(ng-controller="PdfController") .card.card-hint figure.card-hint-icon-container i.fa.fa-lightbulb-o(aria-hidden="true") - p.entry-content(ng-show="entry.humanReadableHint", ng-bind-html="entry.humanReadableHint") - a(ng-href="{{ entry.extraInfoURL }}", target="_blank") #{translate("log_entry_extra_info")} + p.card-hint-text(ng-show="entry.humanReadableHint", ng-bind-html="entry.humanReadableHint") + .clearfix + a.btn.btn-sm.btn-default.pull-right(ng-href="{{ entry.extraInfoURL }}", target="_blank") + i.fa.fa-external-link + | #{translate("log_entry_extra_info")} p.entry-content(ng-show="entry.content") {{ entry.content }} p diff --git a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee index b0121b6c61..16293b0387 100644 --- a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee +++ b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee @@ -2,48 +2,42 @@ define -> [ regexToMatch: /Too many }'s/ extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Too_many_.7D.27s" humanReadableHint: """ -

The reason LaTeX thinks there are too many }'s here is that the opening curly brace is missing after the \\date control sequence and before the word December, so the closing curly brace is seen as one too many (which it is!). In fact, there are other things which can follow the \\date command apart from a date in curly braces, so LaTeX cannot possibly guess that you've missed out the opening curly brace until it finds a closing one!

+ The reason LaTeX thinks there are too many }'s here is that the opening curly brace is missing after the \\date control sequence and before the word December, so the closing curly brace is seen as one too many (which it is!). """ , regexToMatch: /Undefined control sequence/ extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Undefined_control_sequence" humanReadableHint: """ -

In this example, LaTeX is complaining that it has no such command ("control sequence") as \\dtae. Obviously it's been mistyped, but only a human can detect that fact: all LaTeX knows is that \\dtae is not a command it knows about: it's undefined. Mistypings are the most common source of errors. Some editors allow common commands and environments to be inserted using drop-down menus or icons, which may be used to avoid these errors.

+ In this example, LaTeX is complaining that it has no such command ("control sequence") as \\dtae. Obviously it's been mistyped, but only a human can detect that fact: all LaTeX knows is that \\dtae is not a command it knows about: it's undefined. """ , regexToMatch: /Missing \$ inserted/ extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Not_in_Mathematics_Mode" humanReadableHint: """ -

A character that can only be used in the mathematics was inserted in normal text. If you intended to use mathematics mode, then use $...$ or \\begin{math}...\\end{math} or use the 'quick math mode': \\ensuremath{...}. If you did not intend to use mathematics mode, then perhaps you are trying to use a special character that needs to be entered in a different way; for example _ will be interpreted as a subscript operator in mathematics mode, and you need \\_ to get an underscore character.

-

This can also happen if you use the wrong character encoding, for example using utf8 without "\\usepackage[utf8]{inputenc}" or using iso8859-1 without "\\usepackage[latin1]{inputenc}", there are several character encoding formats, make sure to pick the right one.

+ A character that can only be used in the mathematics was inserted in normal text. If you intended to use mathematics mode, then use $...$ or \\begin{math}...\\end{math} or use the 'quick math mode': \\ensuremath{...}. """ , regexToMatch: /Runaway argument/ extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Runaway_argument" humanReadableHint: """ -

In this error, the closing curly brace has been omitted from the date. It's the opposite of the error of too many }'s, and it results in \\maketitle trying to format the title page while LaTeX is still expecting more text for the date! As \\maketitle creates new paragraphs on the title page, this is detected and LaTeX complains that the previous paragraph has ended but \\date is not yet finished.

+ In this error, the closing curly brace has been omitted from the date. It's the opposite of the error of too many }'s, and it results in \\maketitle trying to format the title page while LaTeX is still expecting more text for the date! """ , regexToMatch: /Underfull \\hbox/ extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Underfull_hbox" humanReadableHint: """ -

This is a warning that LaTeX cannot stretch the line wide enough to fit, without making the spacing bigger than its currently permitted maximum. The badness (0-10,000) indicates how severe this is (here you can probably ignore a badness of 1394). It says what lines of your file it was typesetting when it found this, and the number in square brackets is the number of the page onto which the offending line was printed. The codes separated by slashes are the typeface and font style and size used in the line. Ignore them for the moment.

-

This comes up if you force a linebreak, e.g., \\\\, and have a return before it. Normally TeX ignores linebreaks, providing full paragraphs to ragged text. In this case it is necessary to pull the linebreak up one line to the end of the previous sentence.

-

This warning may also appear when inserting images. It can be avoided by using the \\textwidth or possibly \\linewidth options, e.g. \\includegraphics[width=\\textwidth]{image_name}

+ This is a warning that LaTeX cannot stretch the line wide enough to fit, without making the spacing bigger than its currently permitted maximum. The badness (0-10,000) indicates how severe this is (here you can probably ignore a badness of 1394). """ , regexToMatch: /Overfull \\hbox/ extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Overfull_hbox" humanReadableHint: """ -

An overfull \\hbox means that there is a hyphenation or justification problem: moving the last word on the line to the next line would make the spaces in the line wider than the current limit; keeping the word on the line would make the spaces smaller than the current limit, so the word is left on the line, but with the minimum allowed space between words, and which makes the line go over the edge.

-

The warning is given so that you can find the line in the code that originates the problem (in this case: 860-861) and fix it. The line on this example is too long by a shade over 9pt. The chosen hyphenation point which minimizes the error is shown at the end of the line (Win-). Line numbers and page numbers are given as before. In this case, 9pt is too much to ignore (over 3mm), and a manual correction needs making (such as a change to the hyphenation), or the flexibility settings need changing.

-

If the "overfull" word includes a forward slash, such as "input/output", this should be properly typeset as "input\\slash output". The use of \\slash has the same effect as using the "/" character, except that it can form the end of a line (with the following words appearing at the start of the next line). The "/" character is typically used in units, such as "mm/year" character, which should not be broken over multiple lines.

-

The warning can also be issued when the \\end{document} tag was not included or was deleted.

+ An overfull \\hbox means that there is a hyphenation or justification problem: moving the last word on the line to the next line would make the spaces in the line wider than the current limit; keeping the word on the line would make the spaces smaller than the current limit, so the word is left on the line, but with the minimum allowed space between words, and which makes the line go over the edge. """ , regexToMatch: /LaTeX Error: File .* not found/ extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Missing_package" humanReadableHint: """ -

When you use the \\usepackage command to request LaTeX to use a certain package, it will look for a file with the specified name and the filetype .sty. In this case the user has mistyped the name of the paralist package, so it's easy to fix. However, if you get the name right, but the package is not installed on your machine, you will need to download and install it before continuing. If you don't want to affect the global installation of the machine, you can simply download from Internet the necessary .sty file and put it in the same folder of the document you are compiling.

+ When you use the \\usepackage command to request LaTeX to use a certain package, it will look for a file with the specified name and the filetype .sty. In this case the user has mistyped the name of the paralist package, so it's easy to fix. """ ] \ No newline at end of file diff --git a/services/web/public/stylesheets/app/editor/pdf.less b/services/web/public/stylesheets/app/editor/pdf.less index b9b71cc268..25416e0aa0 100644 --- a/services/web/public/stylesheets/app/editor/pdf.less +++ b/services/web/public/stylesheets/app/editor/pdf.less @@ -181,4 +181,31 @@ .card-hint:extend(.card-thin) { margin-top: 10px; + + &-icon-container { + background: currentColor; + width: 2.5rem; + height: 2.5rem; + font-size: 1.5rem; + text-align: center; + border-radius: 50%; + float: left; + margin-right: 10px; + + .fa { + color: #FFF; + } + } + + &-text { + color: @gray-dark; + } + + & + p { + margin-top: 20px; + } + + a { + + } } \ No newline at end of file From 1893ae68a9397c80b902eb28df430894adae2573 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 20 Jun 2016 11:53:10 +0100 Subject: [PATCH 08/15] Add feedback widget for log hints. --- .../web/app/views/project/editor/pdf.jade | 14 +++++++--- .../public/stylesheets/app/editor/pdf.less | 26 ++++++++++++++++++- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index 63add3e559..192bdf71d0 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -109,10 +109,16 @@ div.full-size.pdf(ng-controller="PdfController") figure.card-hint-icon-container i.fa.fa-lightbulb-o(aria-hidden="true") p.card-hint-text(ng-show="entry.humanReadableHint", ng-bind-html="entry.humanReadableHint") - .clearfix - a.btn.btn-sm.btn-default.pull-right(ng-href="{{ entry.extraInfoURL }}", target="_blank") - i.fa.fa-external-link - | #{translate("log_entry_extra_info")} + .card-hint-actions + .card-hint-action-ext-link + a.btn.btn-sm.btn-default(ng-href="{{ entry.extraInfoURL }}", target="_blank") + i.fa.fa-external-link + | #{translate("log_hint_extra_info")} + .card-hint-action-feedback + label.card-hint-enquiry-label #{translate("log_hint_enquiry_helpful")}  + .btn-group.btn-group-sm(role="group") + button.btn.btn-default #{translate("answer_yes")} + button.btn.btn-default #{translate("answer_no")} p.entry-content(ng-show="entry.content") {{ entry.content }} p diff --git a/services/web/public/stylesheets/app/editor/pdf.less b/services/web/public/stylesheets/app/editor/pdf.less index 25416e0aa0..2fa851c190 100644 --- a/services/web/public/stylesheets/app/editor/pdf.less +++ b/services/web/public/stylesheets/app/editor/pdf.less @@ -197,10 +197,34 @@ } } - &-text { + &-text, + &-enquiry-label { color: @gray-dark; + font-size: 0.9rem; + margin-bottom: 30px; } + &-enquiry-label { + font-size: 0.8rem; + margin-bottom: 0; + margin-right: 0.5em; + font-weight: normal; + } + + &-actions { + + } + + &-action-ext-link, + &-action-feedback { + display: inline-block; + } + + &-action-feedback { + float: right; + } + + & + p { margin-top: 20px; } From a8976fd4dc5bc3da51744a527d442df072287b65 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 20 Jun 2016 14:42:36 +0100 Subject: [PATCH 09/15] Use plain links instead of buttons. --- .../web/app/views/project/editor/pdf.jade | 9 +- .../HumanReadableLogsRules.coffee | 82 +++++++++---------- .../public/stylesheets/app/editor/pdf.less | 27 ++++-- 3 files changed, 65 insertions(+), 53 deletions(-) diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index 192bdf71d0..6b24e240e7 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -111,14 +111,13 @@ div.full-size.pdf(ng-controller="PdfController") p.card-hint-text(ng-show="entry.humanReadableHint", ng-bind-html="entry.humanReadableHint") .card-hint-actions .card-hint-action-ext-link - a.btn.btn-sm.btn-default(ng-href="{{ entry.extraInfoURL }}", target="_blank") + a(ng-href="{{ entry.extraInfoURL }}", target="_blank") i.fa.fa-external-link | #{translate("log_hint_extra_info")} .card-hint-action-feedback - label.card-hint-enquiry-label #{translate("log_hint_enquiry_helpful")}  - .btn-group.btn-group-sm(role="group") - button.btn.btn-default #{translate("answer_yes")} - button.btn.btn-default #{translate("answer_no")} + label.card-hint-enquiry-label #{translate("log_hint_enquiry_helpful")} + a #{translate("answer_yes")} + a #{translate("answer_no")} p.entry-content(ng-show="entry.content") {{ entry.content }} p diff --git a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee index 16293b0387..95967fbbce 100644 --- a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee +++ b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee @@ -1,43 +1,43 @@ define -> [ - regexToMatch: /Too many }'s/ - extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Too_many_.7D.27s" - humanReadableHint: """ - The reason LaTeX thinks there are too many }'s here is that the opening curly brace is missing after the \\date control sequence and before the word December, so the closing curly brace is seen as one too many (which it is!). - """ - , - regexToMatch: /Undefined control sequence/ - extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Undefined_control_sequence" - humanReadableHint: """ - In this example, LaTeX is complaining that it has no such command ("control sequence") as \\dtae. Obviously it's been mistyped, but only a human can detect that fact: all LaTeX knows is that \\dtae is not a command it knows about: it's undefined. - """ - , - regexToMatch: /Missing \$ inserted/ - extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Not_in_Mathematics_Mode" - humanReadableHint: """ - A character that can only be used in the mathematics was inserted in normal text. If you intended to use mathematics mode, then use $...$ or \\begin{math}...\\end{math} or use the 'quick math mode': \\ensuremath{...}. - """ - , - regexToMatch: /Runaway argument/ - extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Runaway_argument" - humanReadableHint: """ - In this error, the closing curly brace has been omitted from the date. It's the opposite of the error of too many }'s, and it results in \\maketitle trying to format the title page while LaTeX is still expecting more text for the date! - """ - , - regexToMatch: /Underfull \\hbox/ - extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Underfull_hbox" - humanReadableHint: """ - This is a warning that LaTeX cannot stretch the line wide enough to fit, without making the spacing bigger than its currently permitted maximum. The badness (0-10,000) indicates how severe this is (here you can probably ignore a badness of 1394). - """ - , - regexToMatch: /Overfull \\hbox/ - extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Overfull_hbox" - humanReadableHint: """ - An overfull \\hbox means that there is a hyphenation or justification problem: moving the last word on the line to the next line would make the spaces in the line wider than the current limit; keeping the word on the line would make the spaces smaller than the current limit, so the word is left on the line, but with the minimum allowed space between words, and which makes the line go over the edge. - """ - , - regexToMatch: /LaTeX Error: File .* not found/ - extraInfoURL: "https://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Missing_package" - humanReadableHint: """ - When you use the \\usepackage command to request LaTeX to use a certain package, it will look for a file with the specified name and the filetype .sty. In this case the user has mistyped the name of the paralist package, so it's easy to fix. - """ + regexToMatch: /Too many }'s/ + extraInfoURL: "" + humanReadableHint: """ + The reason LaTeX thinks there are too many }'s here is that the opening curly brace is missing after the \\date control sequence and before the word December, so the closing curly brace is seen as one too many (which it is!). + """ + , + regexToMatch: /Undefined control sequence/ + extraInfoURL: "/learn/Errors:Undefined_control_sequence." + humanReadableHint: """ + In this example, LaTeX is complaining that it has no such command ("control sequence") as \\dtae. Obviously it's been mistyped, but only a human can detect that fact: all LaTeX knows is that \\dtae is not a command it knows about: it's undefined. + """ + , + regexToMatch: /Missing \$ inserted/ + extraInfoURL: "/learn/Errors:Missing_$_inserted" + humanReadableHint: """ + A character that can only be used in the mathematics was inserted in normal text. If you intended to use mathematics mode, then use $...$ or \\begin{math}...\\end{math} or use the 'quick math mode': \\ensuremath{...}. + """ + , + regexToMatch: /Runaway argument/ + extraInfoURL: "/learn/Errors:Undefined_control_sequence." + humanReadableHint: """ + In this error, the closing curly brace has been omitted from the date. It's the opposite of the error of too many }'s, and it results in \\maketitle trying to format the title page while LaTeX is still expecting more text for the date! + """ + , + regexToMatch: /Underfull \\hbox/ + extraInfoURL: "/learn/Errors:Underfull_%5Chbox" + humanReadableHint: """ + This is a warning that LaTeX cannot stretch the line wide enough to fit, without making the spacing bigger than its currently permitted maximum. The badness (0-10,000) indicates how severe this is (here you can probably ignore a badness of 1394). + """ + , + regexToMatch: /Overfull \\hbox/ + extraInfoURL: "" + humanReadableHint: """ + An overfull \\hbox means that there is a hyphenation or justification problem: moving the last word on the line to the next line would make the spaces in the line wider than the current limit; keeping the word on the line would make the spaces smaller than the current limit, so the word is left on the line, but with the minimum allowed space between words, and which makes the line go over the edge. + """ + , + regexToMatch: /LaTeX Error: File .* not found/ + extraInfoURL: "/learn/Errors:missing_package" + humanReadableHint: """ + When you use the \\usepackage command to request LaTeX to use a certain package, it will look for a file with the specified name and the filetype .sty. In this case the user has mistyped the name of the paralist package, so it's easy to fix. + """ ] \ No newline at end of file diff --git a/services/web/public/stylesheets/app/editor/pdf.less b/services/web/public/stylesheets/app/editor/pdf.less index 2fa851c190..cdb994c1b2 100644 --- a/services/web/public/stylesheets/app/editor/pdf.less +++ b/services/web/public/stylesheets/app/editor/pdf.less @@ -195,6 +195,19 @@ .fa { color: #FFF; } + + .alert-danger & { + color: @alert-danger-border; + } + + .alert-warning & { + color: @alert-warning-border; + } + + .alert-info & { + color: @alert-info-border; + } + } &-text, @@ -205,9 +218,8 @@ } &-enquiry-label { - font-size: 0.8rem; + font-size: inherit; margin-bottom: 0; - margin-right: 0.5em; font-weight: normal; } @@ -218,18 +230,19 @@ &-action-ext-link, &-action-feedback { display: inline-block; + font-size: 0.8rem; } &-action-feedback { float: right; + + a { + margin-left: 0.5em; + } } & + p { margin-top: 20px; } - - a { - - } -} \ No newline at end of file +} From baea017adb0d3833f7b19465246ef3a32f407682 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 20 Jun 2016 14:59:30 +0100 Subject: [PATCH 10/15] Better mark-up for analytics tracking. --- services/web/app/views/project/editor/pdf.jade | 10 +++++----- services/web/public/stylesheets/app/editor/pdf.less | 11 +++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index 6b24e240e7..b65c766952 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -110,14 +110,14 @@ div.full-size.pdf(ng-controller="PdfController") i.fa.fa-lightbulb-o(aria-hidden="true") p.card-hint-text(ng-show="entry.humanReadableHint", ng-bind-html="entry.humanReadableHint") .card-hint-actions - .card-hint-action-ext-link + .card-hint-ext-link a(ng-href="{{ entry.extraInfoURL }}", target="_blank") i.fa.fa-external-link | #{translate("log_hint_extra_info")} - .card-hint-action-feedback - label.card-hint-enquiry-label #{translate("log_hint_enquiry_helpful")} - a #{translate("answer_yes")} - a #{translate("answer_no")} + .card-hint-feedback + label.card-hint-feedback-label #{translate("log_hint_enquiry_helpful")} + a.card-hint-feedback-positive #{translate("answer_yes")} + a.card-hint-feedback-negative #{translate("answer_no")} p.entry-content(ng-show="entry.content") {{ entry.content }} p diff --git a/services/web/public/stylesheets/app/editor/pdf.less b/services/web/public/stylesheets/app/editor/pdf.less index cdb994c1b2..19a92fa3ce 100644 --- a/services/web/public/stylesheets/app/editor/pdf.less +++ b/services/web/public/stylesheets/app/editor/pdf.less @@ -211,13 +211,13 @@ } &-text, - &-enquiry-label { + &-feedback-label { color: @gray-dark; font-size: 0.9rem; margin-bottom: 30px; } - &-enquiry-label { + &-feedback-label { font-size: inherit; margin-bottom: 0; font-weight: normal; @@ -227,13 +227,13 @@ } - &-action-ext-link, - &-action-feedback { + &-ext-link, + &-feedback { display: inline-block; font-size: 0.8rem; } - &-action-feedback { + &-feedback { float: right; a { @@ -241,7 +241,6 @@ } } - & + p { margin-top: 20px; } From fe53083afd89168cfb41e69f5652f600e7db0a15 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 20 Jun 2016 15:04:47 +0100 Subject: [PATCH 11/15] Show thank you note after receiving feedback. --- services/web/app/views/project/editor/pdf.jade | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index b65c766952..5fa6ec84ef 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -100,6 +100,7 @@ div.full-size.pdf(ng-controller="PdfController") 'alert-info': entry.level == 'typesetting'\ }" ng-click="openInEditor(entry)" + ng-init="feedbackSent = false;" ) span.line-no span(ng-show="entry.file") {{ entry.file }} @@ -114,10 +115,16 @@ div.full-size.pdf(ng-controller="PdfController") a(ng-href="{{ entry.extraInfoURL }}", target="_blank") i.fa.fa-external-link | #{translate("log_hint_extra_info")} - .card-hint-feedback + .card-hint-feedback(ng-show="!feedbackSent") label.card-hint-feedback-label #{translate("log_hint_enquiry_helpful")} - a.card-hint-feedback-positive #{translate("answer_yes")} - a.card-hint-feedback-negative #{translate("answer_no")} + a.card-hint-feedback-positive( + ng-click="feedbackSent = true;" + ) #{translate("answer_yes")} + a.card-hint-feedback-negative( + ng-click="feedbackSent = true;" + ) #{translate("answer_no")} + .card-hint-feedback(ng-show="feedbackSent") + label.card-hint-feedback-label #{translate("log_hint_enquiry_gratitude")} p.entry-content(ng-show="entry.content") {{ entry.content }} p From d8e0026bc6d2637237a644eea18d3a4b9b3eee8c Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 20 Jun 2016 17:32:57 +0100 Subject: [PATCH 12/15] Add class to enable per-hint feedback tracking. --- services/web/app/views/project/editor/pdf.jade | 9 ++++++--- .../ide/human-readable-logs/HumanReadableLogs.coffee | 3 ++- services/web/public/stylesheets/app/editor/pdf.less | 4 ---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index 5fa6ec84ef..dab38e670d 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -115,8 +115,11 @@ div.full-size.pdf(ng-controller="PdfController") a(ng-href="{{ entry.extraInfoURL }}", target="_blank") i.fa.fa-external-link | #{translate("log_hint_extra_info")} - .card-hint-feedback(ng-show="!feedbackSent") - label.card-hint-feedback-label #{translate("log_hint_enquiry_helpful")} + .card-hint-feedback( + ng-show="!feedbackSent" + ng-class="entry.ruleId" + ) + label.card-hint-feedback-label #{translate("log_hint_feedback_label")} a.card-hint-feedback-positive( ng-click="feedbackSent = true;" ) #{translate("answer_yes")} @@ -124,7 +127,7 @@ div.full-size.pdf(ng-controller="PdfController") ng-click="feedbackSent = true;" ) #{translate("answer_no")} .card-hint-feedback(ng-show="feedbackSent") - label.card-hint-feedback-label #{translate("log_hint_enquiry_gratitude")} + label.card-hint-feedback-label #{translate("log_hint_feedback_gratitude")} p.entry-content(ng-show="entry.content") {{ entry.content }} p diff --git a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee index 5f4627cb95..6c5ef03bea 100644 --- a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee +++ b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee @@ -9,7 +9,8 @@ define [ return rule for rule in ruleset when rule.regexToMatch.test logMessage for entry in parsedLogEntries.all - { humanReadableHint, extraInfoURL } = _getRule entry.message + { regexToMatch, humanReadableHint, extraInfoURL } = _getRule entry.message + entry.ruleId = 'hint_' + regexToMatch.toString().replace(/[^a-zA-Z0-9]/g, '_').toLowerCase() entry.humanReadableHint = humanReadableHint if humanReadableHint? entry.extraInfoURL = extraInfoURL if extraInfoURL? diff --git a/services/web/public/stylesheets/app/editor/pdf.less b/services/web/public/stylesheets/app/editor/pdf.less index 19a92fa3ce..27d943000b 100644 --- a/services/web/public/stylesheets/app/editor/pdf.less +++ b/services/web/public/stylesheets/app/editor/pdf.less @@ -223,10 +223,6 @@ font-weight: normal; } - &-actions { - - } - &-ext-link, &-feedback { display: inline-block; From 1aa7d9c6b377448839c33bc56b01f60cbfcbc35a Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Tue, 21 Jun 2016 10:49:24 +0100 Subject: [PATCH 13/15] Explicitly set link color according to log entry type. --- .../web/public/stylesheets/app/editor/pdf.less | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/services/web/public/stylesheets/app/editor/pdf.less b/services/web/public/stylesheets/app/editor/pdf.less index 27d943000b..1ca40d5179 100644 --- a/services/web/public/stylesheets/app/editor/pdf.less +++ b/services/web/public/stylesheets/app/editor/pdf.less @@ -229,6 +229,20 @@ font-size: 0.8rem; } + &-actions a { + .alert-danger & { + color: @alert-danger-text; + } + + .alert-warning & { + color: @alert-warning-text; + } + + .alert-info & { + color: @alert-info-text; + } + } + &-feedback { float: right; From e607de0b9143b131cc292eac2e2a37f74b3333bf Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Tue, 21 Jun 2016 12:07:47 +0100 Subject: [PATCH 14/15] Safety checks for non-existing values; avoid rendering the hint template when there is no hint. --- .../web/app/views/project/editor/pdf.jade | 2 +- .../HumanReadableLogs.coffee | 10 ++- .../HumanReadableLogsRules.coffee | 84 +++++++++---------- 3 files changed, 49 insertions(+), 47 deletions(-) diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index dab38e670d..618b83bbed 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -106,7 +106,7 @@ div.full-size.pdf(ng-controller="PdfController") span(ng-show="entry.file") {{ entry.file }} span(ng-show="entry.line") , line {{ entry.line }} p.entry-message(ng-show="entry.message") {{ entry.message }} - .card.card-hint + .card.card-hint(ng-if="entry.humanReadableHint") figure.card-hint-icon-container i.fa.fa-lightbulb-o(aria-hidden="true") p.card-hint-text(ng-show="entry.humanReadableHint", ng-bind-html="entry.humanReadableHint") diff --git a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee index 6c5ef03bea..31fc11b6a3 100644 --- a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee +++ b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogs.coffee @@ -9,9 +9,11 @@ define [ return rule for rule in ruleset when rule.regexToMatch.test logMessage for entry in parsedLogEntries.all - { regexToMatch, humanReadableHint, extraInfoURL } = _getRule entry.message - entry.ruleId = 'hint_' + regexToMatch.toString().replace(/[^a-zA-Z0-9]/g, '_').toLowerCase() - entry.humanReadableHint = humanReadableHint if humanReadableHint? - entry.extraInfoURL = extraInfoURL if extraInfoURL? + ruleDetails = _getRule entry.message + if (ruleDetails?) + entry.ruleId = 'hint_' + ruleDetails.regexToMatch.toString().replace(/[^a-zA-Z0-9]/g, '_').toLowerCase() if ruleDetails.regexToMatch? + entry.humanReadableHint = ruleDetails.humanReadableHint if ruleDetails.humanReadableHint? + entry.extraInfoURL = ruleDetails.extraInfoURL if ruleDetails.extraInfoURL? + return parsedLogEntries diff --git a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee index 95967fbbce..a94e756244 100644 --- a/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee +++ b/services/web/public/coffee/ide/human-readable-logs/HumanReadableLogsRules.coffee @@ -1,43 +1,43 @@ define -> [ - regexToMatch: /Too many }'s/ - extraInfoURL: "" - humanReadableHint: """ - The reason LaTeX thinks there are too many }'s here is that the opening curly brace is missing after the \\date control sequence and before the word December, so the closing curly brace is seen as one too many (which it is!). - """ - , - regexToMatch: /Undefined control sequence/ - extraInfoURL: "/learn/Errors:Undefined_control_sequence." - humanReadableHint: """ - In this example, LaTeX is complaining that it has no such command ("control sequence") as \\dtae. Obviously it's been mistyped, but only a human can detect that fact: all LaTeX knows is that \\dtae is not a command it knows about: it's undefined. - """ - , - regexToMatch: /Missing \$ inserted/ - extraInfoURL: "/learn/Errors:Missing_$_inserted" - humanReadableHint: """ - A character that can only be used in the mathematics was inserted in normal text. If you intended to use mathematics mode, then use $...$ or \\begin{math}...\\end{math} or use the 'quick math mode': \\ensuremath{...}. - """ - , - regexToMatch: /Runaway argument/ - extraInfoURL: "/learn/Errors:Undefined_control_sequence." - humanReadableHint: """ - In this error, the closing curly brace has been omitted from the date. It's the opposite of the error of too many }'s, and it results in \\maketitle trying to format the title page while LaTeX is still expecting more text for the date! - """ - , - regexToMatch: /Underfull \\hbox/ - extraInfoURL: "/learn/Errors:Underfull_%5Chbox" - humanReadableHint: """ - This is a warning that LaTeX cannot stretch the line wide enough to fit, without making the spacing bigger than its currently permitted maximum. The badness (0-10,000) indicates how severe this is (here you can probably ignore a badness of 1394). - """ - , - regexToMatch: /Overfull \\hbox/ - extraInfoURL: "" - humanReadableHint: """ - An overfull \\hbox means that there is a hyphenation or justification problem: moving the last word on the line to the next line would make the spaces in the line wider than the current limit; keeping the word on the line would make the spaces smaller than the current limit, so the word is left on the line, but with the minimum allowed space between words, and which makes the line go over the edge. - """ - , - regexToMatch: /LaTeX Error: File .* not found/ - extraInfoURL: "/learn/Errors:missing_package" - humanReadableHint: """ - When you use the \\usepackage command to request LaTeX to use a certain package, it will look for a file with the specified name and the filetype .sty. In this case the user has mistyped the name of the paralist package, so it's easy to fix. - """ -] \ No newline at end of file + # regexToMatch: /Too many }'s/ + # extraInfoURL: "" + # humanReadableHint: """ + # The reason LaTeX thinks there are too many }'s here is that the opening curly brace is missing after the \\date control sequence and before the word December, so the closing curly brace is seen as one too many (which it is!). + # """ + # , + # regexToMatch: /Undefined control sequence/ + # extraInfoURL: "/learn/Errors:Undefined_control_sequence." + # humanReadableHint: """ + # In this example, LaTeX is complaining that it has no such command ("control sequence") as \\dtae. Obviously it's been mistyped, but only a human can detect that fact: all LaTeX knows is that \\dtae is not a command it knows about: it's undefined. + # """ + # , + # regexToMatch: /Missing \$ inserted/ + # extraInfoURL: "/learn/Errors:Missing_$_inserted" + # humanReadableHint: """ + # A character that can only be used in the mathematics was inserted in normal text. If you intended to use mathematics mode, then use $...$ or \\begin{math}...\\end{math} or use the 'quick math mode': \\ensuremath{...}. + # """ + # , + # regexToMatch: /Runaway argument/ + # extraInfoURL: "/learn/Errors:Undefined_control_sequence." + # humanReadableHint: """ + # In this error, the closing curly brace has been omitted from the date. It's the opposite of the error of too many }'s, and it results in \\maketitle trying to format the title page while LaTeX is still expecting more text for the date! + # """ + # , + # regexToMatch: /Underfull \\hbox/ + # extraInfoURL: "/learn/Errors:Underfull_%5Chbox" + # humanReadableHint: """ + # This is a warning that LaTeX cannot stretch the line wide enough to fit, without making the spacing bigger than its currently permitted maximum. The badness (0-10,000) indicates how severe this is (here you can probably ignore a badness of 1394). + # """ + # , + # regexToMatch: /Overfull \\hbox/ + # extraInfoURL: "" + # humanReadableHint: """ + # An overfull \\hbox means that there is a hyphenation or justification problem: moving the last word on the line to the next line would make the spaces in the line wider than the current limit; keeping the word on the line would make the spaces smaller than the current limit, so the word is left on the line, but with the minimum allowed space between words, and which makes the line go over the edge. + # """ + # , + # regexToMatch: /LaTeX Error: File .* not found/ + # extraInfoURL: "/learn/Errors:missing_package" + # humanReadableHint: """ + # When you use the \\usepackage command to request LaTeX to use a certain package, it will look for a file with the specified name and the filetype .sty. In this case the user has mistyped the name of the paralist package, so it's easy to fix. + # """ +] From ed659fd9738cbe857c7abc51e4a799a4f79b583d Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Tue, 21 Jun 2016 14:20:23 +0100 Subject: [PATCH 15/15] Minor UI improvements. --- services/web/app/views/project/editor/pdf.jade | 1 + services/web/public/stylesheets/app/editor/pdf.less | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/services/web/app/views/project/editor/pdf.jade b/services/web/app/views/project/editor/pdf.jade index 618b83bbed..34c9ece719 100644 --- a/services/web/app/views/project/editor/pdf.jade +++ b/services/web/app/views/project/editor/pdf.jade @@ -123,6 +123,7 @@ div.full-size.pdf(ng-controller="PdfController") a.card-hint-feedback-positive( ng-click="feedbackSent = true;" ) #{translate("answer_yes")} + span  /  a.card-hint-feedback-negative( ng-click="feedbackSent = true;" ) #{translate("answer_no")} diff --git a/services/web/public/stylesheets/app/editor/pdf.less b/services/web/public/stylesheets/app/editor/pdf.less index 1ca40d5179..f77d497eb0 100644 --- a/services/web/public/stylesheets/app/editor/pdf.less +++ b/services/web/public/stylesheets/app/editor/pdf.less @@ -214,11 +214,12 @@ &-feedback-label { color: @gray-dark; font-size: 0.9rem; - margin-bottom: 30px; + margin-bottom: 20px; } &-feedback-label { font-size: inherit; + margin-right: 0.5em; margin-bottom: 0; font-weight: normal; } @@ -242,13 +243,10 @@ color: @alert-info-text; } } - - &-feedback { - float: right; - a { - margin-left: 0.5em; - } + &-feedback { + color: @gray-dark; + float: right; } & + p {