From cabfdfafc0bb5aa8c94b31bf72cd560678851638 Mon Sep 17 00:00:00 2001 From: Romain Rigaux Date: Thu, 20 Aug 2020 02:35:06 -0700 Subject: [PATCH] Docs copy button misses ... prefixed code (#6518) Tested in a local build of the docs. e.g. Just above https://huggingface.co/transformers/task_summary.html#causal-language-modeling Copy will copy the full code, e.g. for token in top_5_tokens: print(sequence.replace(tokenizer.mask_token, tokenizer.decode([token]))) Instead of currently only: for token in top_5_tokens: >>> for token in top_5_tokens: ... print(sequence.replace(tokenizer.mask_token, tokenizer.decode([token]))) Distilled models are smaller than the models they mimic. Using them instead of the large versions would help reduce our carbon footprint. Distilled models are smaller than the models they mimic. Using them instead of the large versions would help increase our carbon footprint. Distilled models are smaller than the models they mimic. Using them instead of the large versions would help decrease our carbon footprint. Distilled models are smaller than the models they mimic. Using them instead of the large versions would help offset our carbon footprint. Distilled models are smaller than the models they mimic. Using them instead of the large versions would help improve our carbon footprint. Docs for the option fix: https://sphinx-copybutton.readthedocs.io/en/latest/ --- docs/source/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index b248a1db00..f2a8e16577 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -76,7 +76,8 @@ exclude_patterns = [u'_build', 'Thumbs.db', '.DS_Store'] pygments_style = None # Remove the prompt when copying examples -copybutton_prompt_text = ">>> " +copybutton_prompt_text = r">>> |\.\.\. " +copybutton_prompt_is_regexp = True # -- Options for HTML output -------------------------------------------------