Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close

About r.doqdoq

r.doqdoq is a custom UI for reddit.com inspired by code editors. Makes browsing reddit look like you're coding! It is available in various programming languages (syntax) and with different color schemes to match your ~work~ development environment.

Powered by Flask. Using the reddit_api. Color schemes generated by Pygments.

Setup and Installation

Install requirements.

$ hg clone https://bitbucket.org/john2x/rdoqdoq
$ cd rdoqdoq
$ pip install -r requirements.txt

Run.

$ python app.py

Open http://localhost:5000/ in a browser.

Adding a new syntax template

Coderedd.it makes it easy to add new syntax options. The templates are Jinja. The basic steps are:

  1. Copy an existing syntax template (found in templates/syntaxname/) and make the necessary changes to it (make sure the links don't change and don't forget the elements' classes to give them syntax highlighting)
  2. Add the syntax's name to the syntaxes setting in settings.py.
  3. ???
  4. Profit!

There are several files in a syntax template folder. A short summary for each file and the available variables are listed.

The Pages

These are the files which render the different types of reddit pages.

index.html

Renders the front page.

next() and prev() links in div.nav.

subreddit.html

Renders a particular subreddit.

subreddit in div.subreddit-info

{{ subreddit }} holds a subreddit's info

next() and prev() links in div.nav.

comments.html

Renders a story's comments page.

You can modify how a comment is rendered here.

{{ comment }} in the recursive {% for %} loop holds a comment's info

The Included Snippets

These files are snippets which are included/inserted into the page templates above.

header.html

The header. Goes on top. Includes navigation, authentication, list of subreddits.

{{ my_subreddits }} holds a list of a user's subreddits.

{{ session.username }} is the currently logged in user's username

story.html

Renders a story's details (title, url, subreddit, poster, etc.)

{{ story }} in the {% for %} loop holds a story's info

footer.html

The footer.

Change the syntax, not the content. :)

What the hell? Those templates are a mess!

I know. I'm still trying to figure out a way to best allow easy creation of templates.

CSS Syntax Highlighting Classes

Apply these classes to your elements and they will be syntax highlighted. These are generated by Pygments.

  • c = comment; e.g. # this is a comment
  • k = keyword; e.g. for, if, class
  • l = literal (string, numbers); e.g. 'string', 123
  • m = numeric literal; e.g. 123 (like l but more specific)
  • s = string literal; e.g. 'string' (like l but more specific)
  • nc = class name declaration; e.g. class ClassName() (for ClassName)
  • nf = function name declaration; e.g. function funcName() (for funcName)
  • vc = class variable name; e.g. class ClassName extends BaseClass (for BaseClass)
  • n = generic name; for everything else that might need highlighting

Credits

  • wenbert for hosting and helping me deploy
  • mellort for his reddit_api Python library and for putting up with my incessant questioning
  • Chloyd for being my guinea pig
  • the Reddit community
  • Alexander Sitte for the SQL templates

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.