diff --git a/static/font/Inconsolata.otf b/static/font/Inconsolata.otf new file mode 100755 index 0000000..e7e1fa0 Binary files /dev/null and b/static/font/Inconsolata.otf differ diff --git a/static/js/index.js b/static/js/index.js index 13b404c..18e9191 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -25,6 +25,8 @@ searchBar = $("form#search-bar input[type='text']")[0]; resultsDiv = $("div#results")[0]; var typingTimer, lastValue; +//Obtained by parsing python file with pygments +var codeExample = '
"""\nModule to contain all the project's Flask server plumbing.\n"""\n\nfrom flask import Flask\nfrom flask import render_template, session\n\nfrom bitshift import assets\n# from bitshift.database import Database\n# from bitshift.query import parse_query\n\napp = Flask(__name__)\napp.config.from_object("bitshift.config")\n\napp_env = app.jinja_env\napp_env.line_statement_prefix = "="\napp_env.globals.update(assets=assets)\n\n# database = Database()\n\n@app.route("/")\ndef index():\n    return render_template("index.html")\n\n@app.route("/search/<query>")\ndef search(query):\n    # tree = parse_query(query)\n    # database.search(tree)\n    pass\n\n@app.route("/about")\ndef about():\n    return render_template("about.html")\n\n@app.route("/developers")\ndef developers():\n    return render_template("developers.html")\n\nif __name__ == "__main__":\n    app.run(debug=True)\n
\n' searchBar.onkeyup = typingTimer; // Enable infinite scrolling down the results page. @@ -120,10 +122,7 @@ function queryServer(){ for(var result = 0; result < 20; result++){ var newDiv = document.createElement("div"); newDiv.classList.add("result"); - newDiv.innerHTML = Math.random(); - newDiv.style.textAlign = "center"; - newDiv.style.color = "#" + Math.floor(Math.random() * - 16777215).toString(16); + newDiv.innerHTML = codeExample; resultDivs.push(newDiv); } diff --git a/static/sass/index.sass b/static/sass/index.sass index e20b53f..44c0945 100644 --- a/static/sass/index.sass +++ b/static/sass/index.sass @@ -283,7 +283,8 @@ div#results width: 80% div.result - background-color: #F8F8F8 + background-color: none + font-family: Arial, "Inconsolata" margin-bottom: 10% margin-top: 1% padding: 1% diff --git a/templates/index.html b/templates/index.html index 8c14b5c..3813a56 100644 --- a/templates/index.html +++ b/templates/index.html @@ -11,6 +11,7 @@ {{ assets.tag("lib/typeahead.bundle.min.js") }} {{ assets.tag("index.css") }} + {{ assets.tag("highlight.css") }}