Skip to content

Commit

Permalink
Cleaning the libraries (partial progress)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenmonks committed Jul 15, 2024
1 parent 974f4f8 commit 4faa9fb
Show file tree
Hide file tree
Showing 25 changed files with 5,712 additions and 1,592 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ initproofs.js

# ignore the following folders from math299
/math299
/pima
studentfiles299
7 changes: 7 additions & 0 deletions favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
window.addEventListener('load', () => {

// toggle to use the instructor menu
const instructormode = false
const instructormode = true

// make sure editor.js doesn't show or hide the menu overwriting ours
localStorage.setItem( 'lurch-developer mode on', false )
Expand Down
2 changes: 1 addition & 1 deletion lde/src/experimental/lode.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ global.makedoc = makedoc
// store the folders we want to be scanned as part of the indexing page
// relative folders are relative to the root of the server (the lurch folder
// of the LFY)
global.contentFolders = ['pima','math','math299','help']
global.contentFolders = ['math','help','assignments','math299','pima']
global.toc = () => generatePage(...contentFolders)
global.scrape = scrape
global.scrapeToGomez = () =>
Expand Down
2 changes: 1 addition & 1 deletion lde/src/experimental/parsers/lurch-to-tex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lde/src/experimental/parsers/lurch-to-tex.peggy
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ StringLiteral = $('"' [^"]* '"')
Shorthand = Equiv / a:(BIH / Ruleset / Rule / Thm / Proof / Cases / Subs)
!alphanum { return txt(a) }
// Shorthands
Equiv = 'equiv'i { return '\\text{ iff }' }
Equiv = 'equiv'i { return '~\\equiv~' }
BIH = $('since'i / 'because'i / 'recall'i)
Ruleset = $(('rules'i / 'axioms'i / 'definitions'i) ':'?)
Rule = $(('rule'i / 'axiom'i / 'definition'i) ':'?)
Expand Down
5 changes: 5 additions & 0 deletions lurchmath/expressions.js
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,10 @@ export class Expression extends Atom {
if ( this.isInAdvancedMode() ) {
const { lurchNotation } = this.loadAdvancedModeData()
const ans = parse( lurchNotation, 'lurchNotation' )
console.log(`Parsing ${lurchNotation} and got ${ans.length} lcs`)
console.log(ans[0].toPutdown())
console.log(ans[0].isA('given'))
console.log(ans[0])
const results = this.getValidationResults()
// there might be more than one result, e.g for transitive chains,
// so show the worst one
Expand All @@ -763,6 +767,7 @@ export class Expression extends Atom {
if (results.length>0 && ans.length==1) {
ans.forEach( x => x.setAttribute('ExpectedResult',result) )
}
console.log(ans)
return ans
}
}
Expand Down
6 changes: 3 additions & 3 deletions lurchmath/grading-tools/toc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
* Lurch files and libraries in a local LFY installation. To run it, simply
* call `toc()` in Lode.
*
* It will create a file in the root of the LFY called `toc.html`. When opened
* It will create a file in the root of the Site called `toc.html`. When opened
* in the browser it shows a collapsible nested list of all of the folders
* specified by the Lode global `contentFolders` array, and hyperlinks to any
* `.lurch` files in those folders that when clicked will open the given file
* directly in Lurch. For lurch files in local folders that are not contained in
* the LFY root you can create a symbolic link to those folders to have them
* the Site root you can create a symbolic link to those folders to have them
* included.
*/

Expand All @@ -25,7 +25,7 @@ const CSS = fs.readFileSync( path.join(
path.dirname( url.fileURLToPath( import.meta.url ) ),
'toc.css' ), 'utf8' )

// We can assume that for an LFY the root folder of the server contains
// We assume that for an LFY the root folder of the server contains
// the lurchmath repo as one of its subfolder.
const rootFolder = path.resolve(url.fileURLToPath( import.meta.url ),'../../..')

Expand Down
8 changes: 4 additions & 4 deletions lurchmath/lde-cdn.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
*/

export {
LogicConcept, MathConcept,
Environment, Declaration, Expression, LurchSymbol
} from 'https://cdn.jsdelivr.net/gh/lurchmath/lde@master/src/index.js'
LogicConcept, MathConcept,
Environment, Declaration, Expression, LurchSymbol
} from '../lde/src/index.js'

import branchLDE from 'https://cdn.jsdelivr.net/gh/lurchmath/lde@a584652687e37356dad01cd7eeea84cecad56b52/src/experimental/global-validation.js'
import branchLDE from '../lde/src/experimental/global-validation.js'
export const LDE = branchLDE
2 changes: 1 addition & 1 deletion lurchmath/parsers/lurch-to-tex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lurchmath/parsers/lurch-to-tex.peggy
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ StringLiteral = $('"' [^"]* '"')
Shorthand = Equiv / a:(BIH / Ruleset / Rule / Thm / Proof / Cases / Subs)
!alphanum { return txt(a) }
// Shorthands
Equiv = 'equiv'i { return '\\text{ iff }' }
Equiv = 'equiv'i { return '~\\equiv~' }
BIH = $('since'i / 'because'i / 'recall'i)
Ruleset = $(('rules'i / 'axioms'i / 'definitions'i) ':'?)
Rule = $(('rule'i / 'axiom'i / 'definition'i) ':'?)
Expand Down
Loading

0 comments on commit 4faa9fb

Please sign in to comment.