Skip to content

Commit

Permalink
Merge pull request #121 from UofGAnalytics/explicitly-show-env-sectio…
Browse files Browse the repository at this point in the history
…ns-with-cli-flags

explicitly show env sections with cli flag
  • Loading branch information
dmca-glasgow committed Jun 30, 2022
2 parents a31d62c + 740ceb5 commit dafb3ed
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
12 changes: 10 additions & 2 deletions compiler/src/mdast/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ export function environment(ctx: Context, targetPdf?: boolean) {
if (platforms.includes(node.name)) {
node.data = {
hProperties: {
className: ['platform', node.name],
className: [
'platform',
node.name,
platformFlag === node.name ? 'show' : '',
],
},
};
if (platformFlag && platformFlag !== node.name) {
Expand All @@ -74,7 +78,11 @@ export function environment(ctx: Context, targetPdf?: boolean) {
if (programs.includes(node.name)) {
node.data = {
hProperties: {
className: ['program', node.name],
className: [
'program',
node.name,
programFlag === node.name ? 'show' : '',
],
},
};
if (programFlag && programFlag !== node.name) {
Expand Down
4 changes: 2 additions & 2 deletions template/src/styles/environment.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
padding: 0 1em 0 0.25em;
}

.platform {
.platform:not(.show) {
display: none;
}

Expand All @@ -12,7 +12,7 @@ html.platform-linux .platform.linux {
display: block;
}

.program {
.program:not(.show) {
display: none;
}

Expand Down
8 changes: 1 addition & 7 deletions template/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ const {
generateJSReferences
} = require('mini-html-webpack-plugin');

const COURSE = 'apm'
const UNIT = 'week-2.html'
const htmlFilePath = `../fixtures/${COURSE}/build/${UNIT}`

const isProd = process.env.NODE_ENV === 'production';

const plugins = [
Expand All @@ -31,7 +27,7 @@ if (isProd) {
if (!isProd) {
plugins.push(
// new WatchExternalFilesPlugin({ files: [htmlFilePath] }),
new MiniHtmlWebpackPlugin({ template })
new MiniHtmlWebpackPlugin()
)
}

Expand Down Expand Up @@ -100,7 +96,6 @@ module.exports = {
function template({ css, js2 }) {
const cssTags = generateCSSReferences({ files: css })
const jsTags = generateJSReferences({ files: js2 })
const content = fs.readFileSync(htmlFilePath, 'utf-8')
return `
<!DOCTYPE html>
<html lang="en">
Expand All @@ -112,7 +107,6 @@ function template({ css, js2 }) {
${cssTags}
</head>
<body>
${content}
<div id="modal">
<div id="modal-bg"></div>
<div id="modal-wrapper">
Expand Down

0 comments on commit dafb3ed

Please sign in to comment.