Skip to content

Generating A Word Cloud for Your Book

Run the Wordloud MicroSim

Word clouds for intelligent textbooks are graphic images that display the most important concepts in a book where the size of the font is related to how frequently the concept appears in the textbook or how important the concept is in the textbook.

Wordclouds MicroSims can be easily be generated by generative AI applications.

Here is a sample prompt to generate a wordcloud

Basic Prompt

Prompt

Create a list of the 50 most important terms in a course on [Course Name]. Create a single HTML file with embedded javascript using the wordcloud2 library that displays a word-cloud of these words.

For each word or phrase, rank it on a scale of 20 to 70 with the with the most important word or phrases given a score of 70.

Prompt 2: Provide the List of Words

Prompt

Given the CSV list of phrases below, create a single HTML file that uses the wordcloud2 javascript library to create a wordcloud using the weights after the column. When the user clicks on the link allow them to go to the glossary at href="../glossary.md#NAME

LABEL, WEIGHT Intelligent Textbook,70 MicroSim,65 Open Standards,60 Markdown,60 mkdocs,55 mkdocs-material,55 Theme,45 Build Process,55 mkdocs.yml,50 Navigation,50 Docs,45 Images,45 Links,45 Deep Linking,40 Search,50 Admonitions,45 Assessments,45 Footer,40 License,40 Previous and Next Page,40 Social Previews,40 Logo,30 Favicon,30 Equations,30 LaTeX,25 MathJax,25 Code Highlighting,25 Simulations,25 p5.js,40 iframe,40 Glossary,50 Table of Contents,45 Prompts,50 Open Graph,45 Preview Testing,40 Feedback Form,40 Google Analytics,50 Plugins,45 Conda,40 Python,40 Learning Graph,50 Chatbot,45 Recommendation,45 Broken Link,35 GitHub Pages,40

Prompt 3: Provide the Wordlist Code

Use the following to link from the word to the glossary term:

1
2
3
4
5
6
7
const wordList = wordData.map(([label, weight]) => {
    return [
        label,
        weight,
        () => window.location.href = `../../glossary#${label.replace(/\s+/g, '-').toLowerCase()}`
    ];
    });

Note that this converts the entire string to lowercase and replaces the spaces with a dash to conform to the standards used by mkdocs-material.