From 6f5d3ed146e9f144b04543ab91aa4db49b78c0fa Mon Sep 17 00:00:00 2001 From: Andrey Cizov Date: Mon, 16 Sep 2019 18:20:20 +0100 Subject: [PATCH] We don't support rendering bare .rst files. Fix #17 #18 --- lib/sphinx-preview.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/sphinx-preview.js b/lib/sphinx-preview.js index f1fdc5f..5348c7c 100644 --- a/lib/sphinx-preview.js +++ b/lib/sphinx-preview.js @@ -39,7 +39,7 @@ export default { this.openBrowser(); }); } else { - atom.notifications.addWarning('Active file must have reStructuredText extension (.rst)'); + atom.notifications.addWarning('Active file must have reStructuredText extension (.rst) and must be opened as part of a Project Folder'); } }, @@ -218,6 +218,10 @@ export default { }, isActiveFileRst() { + if(!this.getCurrProjectPath()) { + return false; + } + const editor = atom.workspace.getActivePaneItem(); if (!editor || !editor.buffer) return false; const activeFilePath = editor.buffer.file.path;