Skip to content

Instantly share code, notes, and snippets.

View tk0miya's full-sized avatar

Takeshi KOMIYA tk0miya

View GitHub Profile
from functools import wraps
def memoize(func):
cache = {}
@wraps(func)
def wrapper(*args, **kwargs):
key = args + tuple(kwargs.items())
if key not in cache:

sphihxcontrib_markdown

experimental implementation to use markdown as input of Sphinx.

How to install

  1. install remarkdown
ここに記載されている内容のすべては私一個人の意見であり、所属先の見解とは関係ありません。
と書いておけと言われました。
# -*- coding: utf-8 -*-
from setuptools import setup
setup()
# -*- coding: utf-8 -*-
#
# Sphinx extension for renaming _static/ directory
#
# Author: Takeshi KOMIYA / License: BSD
#
import re
import os
import shutil
@tk0miya
tk0miya / gist:1e5c01421baf4c675359
Last active August 29, 2015 14:10
#ごちうさたーん Advent Calendar 4日目: 食べたいもの。

この記事は #ごちうさたーん Advent Calendar 4日目の記事です。

#ごちうさたーん Advent Calendar の詳細については https://twitter.com/wonderful_panda/status/538109851981721600 を御覧ください。

肉のエアーズロック 肉のエアーズロックをお願いします。

次は @wonderful_panda さんです。

@tk0miya
tk0miya / gist:23da6d2c5a50f7b4e291
Created April 18, 2015 06:09
connpass に掲載されている SphinxJP 関連のイベントを一覧で表示する
# -*- coding: utf-8 -*-
# イベントページの自動更新に使えないかと考えたが、使えないことに気づいたのでここに埋める
import json
import arrow
from urllib import urlopen
from operator import itemgetter
events = {}
# -*- coding: utf-8 -*-
from docutils import nodes
def generate_rawrole(format):
def role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
return [nodes.raw('', text, format=format)], []
return role
# -*- coding: utf-8 -*-
#
# localsectnum.py: Yet another section numbering extension
#
# 拡張を読み込むと、セクション名の "#." がセクション番号に展開されます。
# セクション番号はドキュメントをまたぐとリセットされます。
#
# 注意:
# * ``toctree`` ディレクティブの ``:numbered:`` オプションと機能が干渉するため、
# 同時に利用できません