Changes in formatting

This commit is contained in:
Jared He 2021-06-13 23:56:31 -05:00
parent a02a45d523
commit c6180ae95c
4 changed files with 1070 additions and 75 deletions

View File

@ -7,7 +7,7 @@ var showdown = require("showdown");
const converterShowdown = new showdown.Converter();
const xmlJs = require("xml-js");
fs.readFile("./events.xml", "utf8", (err, data) => {
fs.readFile("./events-test.xml", "utf8", (err, data) => {
if (err) {
console.error(err);
return;
@ -21,8 +21,7 @@ fs.mkdir("./markdown-events/", { recursive: true }, (err) => {
const parseTime = (dateStr, timeStr, title, currentTerm) => {
if (/-/.exec(timeStr)) {
console.error(`${title}, ${currentTerm} has a date range: ${timeStr}`);
return;
timeStr = timeStr.split('-')[0];
}
// converting cases like 7pm to 7PM
timeStr = timeStr.toUpperCase();
@ -38,7 +37,6 @@ const parseTime = (dateStr, timeStr, title, currentTerm) => {
const OFFSET_FROM_EST = +1;
let date = new Date(`${dateStr} ${timeStr}`);
date.setHours(date.getHours() + OFFSET_FROM_EST);
return date;
};
@ -77,17 +75,29 @@ const parseXML = (XML) => {
abstract = converterShowdown.makeMarkdown(
xmlJs.js2xml(js.elements[0].elements[i].elements[1])
);
abstract = abstract.replace(/<br>/g, "\n");
}
let registerLink = "";
let registerLink = null;
// detects a link in markdown such as [CSC Club Website](<http://csclub.uwaterloo.ca//>)
const markdownLinkDetectRegex = /(?<=\[(.*)\]\(<)(.*)(?=>\))/;
if (markdownLinkDetectRegex.exec(abstract)) {
registerLink = markdownLinkDetectRegex.exec(abstract)[0];
} else {
registerLink = "no link";
}
let mdx = `export const metadata = {
name: "${title}",
short: "${short}",
date: new Date("${date.toString()}"),
online: ${online},
location: "${location}"`;
registerLink
? (mdx += `,
registerLink: "${registerLink}"`)
: (mdx += "");
mdx += `
}
const mdx = `export const metadata = {\n name: "${title}",\n short: "${short}",\n date: "${date}",\n online: ${online},\n location: "${location}",\n registerLink: "${registerLink}"\n}\n\n${abstract}`;
${abstract}`;
// remove invalid characters from filenames
let mdxTitle = title.replace(/[\\\\/:*?\"<>|]/g, "");
mdxTitle = mdxTitle.replace(/(\s+)/g, "-");
@ -100,7 +110,7 @@ const parseXML = (XML) => {
}
);
fs.writeFile(
`./markdown-events/${currentTerm}/${mdxTitle}.mdx`,
`./markdown-events/${currentTerm}/${mdxTitle}.event.mdx`,
mdx,
(err) => {
if (err) throw err;

View File

@ -1,75 +1,35 @@
<eventdefs>
<!-- Spring 2021 -->
<eventitem date="2021-05-24" time="7:00PM" room="Online" title="CSC x SE Soc: Interview Prep">
<eventitem date="2015-07-08" time="5pm" room="MC 4060"
title="Infrasound is all around us">
<short>
<p>CSC and SE Soc are hosting an Interview Prep Workshop next week! Join Kristy Gao and Bimesh De Silva as they review the interview process, from behavioural to technical interviews. They'll finish off with live mock interviews, and the event will be held on Twitch (https://www.twitch.tv/uwcsclub).</p>
<p>
Ambient infra sound surrounds us. Richard Mann presents his current
research and equipment on measuring infra sound, and samples of recorded
infra sound.
</p>
</short>
<abstract>
<p>Browsing through your unsolved Leetcode problems? Flipping open CTCI for the first time? Have no clue what to expect from a technical interview or just need an interview refresher? </p>
<p>We've got you covered at our CSC x SE Soc Interview Prep Workshop this Monday, May 24th from 7:00-8:30pm ET! Live-streamed on Twitch, Kristy Gao and Bimesh De Silva will be walking through important aspects of the interview process from coding challenges to behavioural interviews to algorithmic interviews, go through some live mock interviews, and share their tips and techniques along the way!</p>
<p>Registration isn't required, we'll just be sending you an email reminder, as well as inviting you to our calendar event!</p>
<p>The event will be hosted on Twitch at <a href="http://bit.ly/csc-sesoc-interview-prep-signup">http://bit.ly/csc-sesoc-interview-prep-signup</a></p>
<p>Register at!</p>
</abstract>
</eventitem>
<p>
Infra sound refers to sound waves below the range of human hearing.
Infra sound comes from a number of natural phenomena including weather
changes, thunder, and ocean waves. Common man made sources include
heating and ventilation systems, industrial machinery, moving vehicle
cabins (air, trains, cars), and energy generation (wind turbines, gas
plants).
<br></br>
In this talk Richard Mann will present equipment he has built to measure infra sound, and
analyse some of the infra sound he has recorded.
<br />
Note: In Winter 2016 Richard Mann will be offering a new course, in Computer Sound. The
course will appear as CS489/CS689 ("Topics in Computer Science").
<!-- Winter 2021-->
<eventitem date="2021-05-17" time="8pm" room="DC" title="CSC BOT &#38; Game Night">
<short>
<p>
Learn about our plans for the term and play some games with us.
</p>
</short>
<abstract>
<p>Kick off your Spring term with CSC! Come join us on Discord to learn more about what we'll be up to this term and how you can participate!</p>
<p>Afterwards, stick around for a relaxing and fun game night. See you there!</p>
<h1>Here, I am also testing with </h1>
<h2>Many headings, as well as <strong>bold text</strong> and <i>italics</i></h2>
<h4>More headings</h4>
<ul>
<li>One</li>
<li>Unordered</li>
<li>List</li>
</ul>
<ol>
<li>One</li>
<li>Ordered</li>
<li>List</li>
</ol>
</abstract>
</eventitem>
<eventitem date="2018-11-05" time="5:30 pm" room="MC-4063"
title="BBC micro:bit computer: What is it good for?">
<short>
<p>
Professor Richard Mann will be talking about the BBC micro:bit, an embedded computer that is popular with hobbyists and comes with a variety of peripherals.
</p>
</short>
<abstract>
<p>This talk was cancelled. The material for the talk can be found <a href="http://www.cs.uwaterloo.ca/~mannr">here.</a></p>
<h3>Abstract:</h3>
<p>
BBC micro:bit (microbit.org) was introduced in 2015 and has since become popular with educators and hobbyists.
</p><p>
Micro:bit uses an ARM Cortex M0 processor running the "mbed" OS/runtime (mbed.arm.com). It has a built in LED 7x7 array, two buttons, compass, accelerometer, infra red transceivers, and low power wireless communication. Most importantly, it has multiple analog and digital pins to connect to the external world.
</p><p>
Web based tools compile gui/blocks, javascript, or python to executable (HEX) files that run on the device. The device appears as a USB drive. It is programmed by copying (dragging) the HEX image to the device. Once programmed, the device runs standalone and communicates with the the host computer via a serial port API.
</p><p>
All of this is great fun and a gateway into electronics and real time programming.
</p><p>
In this talk I will present a brief introduction to micro:bit, electronics, and electronic signal measurement (voltmeter, function generator, oscilloscope).
</p><p>
We will measure the run time performance of the micro:bit, in particular the operation of the analog inputs and outputs and the response time/latency of the device and consider its suitability for user interface, music and audio projects.
</p>
<h3>Bio:</h3>
<p>
Richard Mann is Associate Professor in Computer Science. His research is in AI, Sound/Audio, Acoustics, and Electro/acoustic measurement. Details at www.cs.uwaterloo.ca/~mannr
</p><p>
In W19 I will teach: CS489 -- Advanced topics, Computational Sound and Audio. This is a project-based course (no final).
</p><p>
I am also looking for URA students in the Sound/Audio area.
Karsten
This
is a project-based course (60% assignments, 40% project, no final).
Details at his web page,
<a href="http://www.cs.uwaterloo.ca/~mannr">~mannr</a>.
</p>
</abstract>
</eventitem>

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
{
"dependencies": {
"jsdom": "^16.6.0",
"showdown": "^1.9.1",
"xml-js": "^1.6.11"
}