Skip to content

Commit

Permalink
Make rtd build more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
emilydolson committed Mar 6, 2021
1 parent 474b740 commit 8eca3ba
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 18 deletions.
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.todo',
'sphinx_rtd_theme',
Expand Down Expand Up @@ -206,3 +205,4 @@
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
extensions.append('sphinx.ext.coverage')
3 changes: 2 additions & 1 deletion include/emp/web/Button.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace web {
class Button : public internal::WidgetFacet<Button> {
friend class ButtonInfo;
protected:

#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Buttons associated with the same DOM element share a single ButtonInfo object.
class ButtonInfo : public internal::WidgetInfo {
friend Button;
Expand Down Expand Up @@ -79,6 +79,7 @@ namespace web {
public:
virtual std::string GetType() override { return "web::ButtonInfo"; }
}; // End of ButtonInfo definition
#endif // DOXYGEN_SHOULD_SKIP_THIS


// Get a properly cast version of indo.
Expand Down
4 changes: 2 additions & 2 deletions include/emp/web/Canvas.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace web {
class Canvas : public internal::WidgetFacet<Canvas> {
friend class CanvasInfo;
protected:

#ifndef DOXYGEN_SHOULD_SKIP_THIS
class CanvasInfo : public internal::WidgetInfo {
friend Canvas;

Expand Down Expand Up @@ -106,7 +106,7 @@ namespace web {
virtual std::string GetType() override { return "web::CanvasInfo"; }

}; // End of ButtonInfo definition.

#endif // DOXYGEN_SHOULD_SKIP_THIS

// Get a properly cast version of indo.
CanvasInfo * Info() { return (CanvasInfo *) info; }
Expand Down
3 changes: 2 additions & 1 deletion include/emp/web/FileInput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ namespace web {
protected:

// FileInputs associated with the same DOM element share a single FileInputInfo object.
#ifndef DOXYGEN_SHOULD_SKIP_THIS
class FileInputInfo : public internal::WidgetInfo {
friend FileInput;
protected:
Expand Down Expand Up @@ -83,7 +84,7 @@ namespace web {
public:
virtual std::string GetType() override { return "web::FileInputInfo"; }
}; // End of FileInputInfo definition

#endif // DOXYGEN_SHOULD_SKIP_THIS

// Get a properly cast version of indo.
FileInputInfo * Info() { return (FileInputInfo *) info; }
Expand Down
47 changes: 45 additions & 2 deletions include/emp/web/Font.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ namespace web {
std::string line_color; ///< Color of lines through the text (underline, linethrough, etc.)

bool is_bold; ///< Is this font bold?
bool is_italic; ///< Is this font itaic?
bool is_smallcaps; ///< Should this test be in small caps?
bool is_italic; ///< Is this font italic?
bool is_smallcaps; ///< Should this text be in small caps?
bool is_underlined; ///< Should this text be underlined?
bool is_overlined; ///< Should this text have a line above it?
bool is_linethrough; ///< Should this text have a line through it?
Expand All @@ -51,29 +51,63 @@ namespace web {
Font & operator=(const Font &) = default;
Font & operator=(Font &&) = default;

/// @returns font family
const std::string & GetFamily() const { return family; }
/// @returns font size (in pixels)
int GetSize() const { return size; }
/// @returns font color
const std::string & GetColor() const { return color; }
/// @returns color of lines through text (underline or strikethrough)
const std::string & GetLineColor() const { return line_color; }
/// @returns boolean indicating whether font is bold
bool IsBold() const { return is_bold; }
/// @returns boolean indicating whether font is italic
bool IsItalic() const { return is_italic; }
/// @returns boolean indicating whether font is in small caps
bool IsSmallcaps() const { return is_smallcaps; }
/// @returns boolean indicating whether font is underlined
bool IsUnderlined() const { return is_underlined; }
/// @returns boolean indicating whether font is overlined
bool IsOverlined() const { return is_overlined; }
/// @returns boolean indicating whether font is strikethrough
bool IsStrikethrough() const { return is_linethrough; }
/// @returns boolean indicating whether font is wavy line
bool IsWavyLine() const { return is_wavy_line; }
/// @returns boolean indicating whether font has any kind of line (underline, overline, or strikethrough)
bool HasLine() const { return is_underlined || is_overlined || is_linethrough; }

/// Sets font family to specified value
/// @returns reference to this font for easy chaining
Font & SetFamily(const std::string & _family) { family = _family; return *this; }
/// Sets font size to specified value
/// @returns reference to this font for easy chaining
Font & SetSize(int _size) { size = _size; return *this; }
/// Sets font color to specified value
/// @returns reference to this font for easy chaining
Font & SetColor(const std::string & _color) { color = _color; return *this; }
/// Sets color of any lines through, under, or over this font
/// @returns reference to this font for easy chaining
Font & SetLineColor(const std::string & _color) { line_color = _color; return *this; }
/// Sets whether font is bold
/// @returns reference to this font for easy chaining
Font & SetBold(bool _in=true) { is_bold = _in; return *this; }
/// Sets whether font is italic
/// @returns reference to this font for easy chaining
Font & SetItalic(bool _in=true) { is_italic = _in; return *this; }
/// Sets whether font is small caps
/// @returns reference to this font for easy chaining
Font & SetSmallcaps(bool _in=true) { is_smallcaps = _in; return *this; }
/// Sets whether font is underlined
/// @returns reference to this font for easy chaining
Font & SetUnderlined(bool _in = true) { is_underlined = _in; return *this; }
/// Sets whether font is overlined
/// @returns reference to this font for easy chaining
Font & SetOverlined(bool _in = true) { is_overlined = _in; return *this; }
/// Sets whether font is strikethrough-ed
/// @returns reference to this font for easy chaining
Font & SetStrikethrough(bool _in = true) { is_linethrough = _in; return *this; }
/// Sets whether font is wavy line
/// @returns reference to this font for easy chaining
Font & SetWavyLine(bool _in = true) { is_wavy_line = _in; return *this; }

/// Take a Style object an fill it out based on this font information.
Expand All @@ -95,12 +129,15 @@ namespace web {
}
}

/// @returns a style object filled out according to this font information
Style AsStyle() const {
Style style;
ConfigStyle(style);
return style;
}

/// @returns a string containing the html necessary to open a span
/// element using this font.
std::string GetHTMLStart() {
std::stringstream ss;
ss << "<span style=\"color:" << color
Expand All @@ -120,8 +157,12 @@ namespace web {
ss << "\">";
return ss.str();
}

/// @returns a string containing the html necessary to close a span
/// element created by \c GetHTMLStart()
std::string GetHTMLEnd() { return "</span>"; }

/// Fonts will evaluate to equal if all of their properties are the same
bool operator==(const Font & _in) const {
return (family == _in.family)
&& (size == _in.size)
Expand All @@ -136,6 +177,8 @@ namespace web {
&& (is_wavy_line == _in.is_wavy_line)
;
}

/// Fonts will evaluate to equal if all of their properties are the same
bool operator!=(const Font & _in) const { return !operator==(_in); }
};

Expand Down
4 changes: 2 additions & 2 deletions include/emp/web/Image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace web {
class Image : public internal::WidgetFacet<Image> {
friend class ImageInfo;
protected:

#ifndef DOXYGEN_SHOULD_SKIP_THIS
class ImageInfo : public internal::WidgetInfo {
friend Image;

Expand Down Expand Up @@ -60,7 +60,7 @@ namespace web {
public:
virtual std::string GetType() override { return "web::ButtonInfo"; }
};

#endif // DOXYGEN_SHOULD_SKIP_THIS

// Get a properly cast version of indo.
ImageInfo * Info() { return (ImageInfo *) info; }
Expand Down
8 changes: 6 additions & 2 deletions include/emp/web/Input.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace web {
class Input : public internal::WidgetFacet<Input> {
friend class InputInfo;
protected:

#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Inputs associated with the same DOM element share a single InputInfo object.
class InputInfo : public internal::WidgetInfo {
friend Input;
Expand Down Expand Up @@ -221,7 +221,7 @@ namespace web {
public:
virtual std::string GetType() override { return "web::InputInfo"; }
}; // End of InputInfo definition

#endif // DOXYGEN_SHOULD_SKIP_THIS

// Get a properly cast version of info.
InputInfo * Info() { return (InputInfo *) info; }
Expand Down Expand Up @@ -294,18 +294,22 @@ namespace web {

/// Update the min
Input & Min(const std::string & in_m) { Info()->UpdateMin(in_m); return *this; }
/// Update the min
Input & Min(const double & in_m) { Info()->UpdateMin(in_m); return *this; }

/// Update the max
Input & Max(const std::string & in_m) { Info()->UpdateMax(in_m); return *this; }
/// Update the max
Input & Max(const double & in_m) { Info()->UpdateMax(in_m); return *this; }

/// Update the current value
Input & Value(const std::string & in_m) { Info()->UpdateValue(in_m); return *this; }
/// Update the current value
Input & Value(const double & in_m) { Info()->UpdateValue(in_m); return *this; }

/// Update the current step size
Input & Step(const std::string & in_m) { Info()->UpdateStep(in_m); return *this; }
/// Update the current step size
Input & Step(const double & in_m) { Info()->UpdateStep(in_m); return *this; }

/// Setup this Input to have autofocus (or remove it!)
Expand Down
4 changes: 2 additions & 2 deletions include/emp/web/Selector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace web {
class Selector : public internal::WidgetFacet<Selector> {
friend class SelectorInfo;
protected:

#ifndef DOXYGEN_SHOULD_SKIP_THIS
class SelectorInfo : public internal::WidgetInfo {
friend Selector;
protected:
Expand Down Expand Up @@ -106,7 +106,7 @@ namespace web {
public:
virtual std::string GetType() override { return "web::SelectorInfo"; }
}; // End of SelectorInfo class.

#endif // DOXYGEN_SHOULD_SKIP_THIS

// Get a properly cast version of indo.
SelectorInfo * Info() { return (SelectorInfo *) info; }
Expand Down
3 changes: 2 additions & 1 deletion include/emp/web/TextArea.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace web {
protected:

// TextAreas associated with the same DOM element share a single TextAreaInfo object.
#ifndef DOXYGEN_SHOULD_SKIP_THIS
class TextAreaInfo : public internal::WidgetInfo {
friend TextArea;
protected:
Expand Down Expand Up @@ -94,7 +95,7 @@ namespace web {
public:
virtual std::string GetType() override { return "web::TextAreaInfo"; }
}; // End of TextAreaInfo definition

#endif // DOXYGEN_SHOULD_SKIP_THIS

// Get a properly cast version of indo.
TextAreaInfo * Info() { return (TextAreaInfo *) info; }
Expand Down
4 changes: 2 additions & 2 deletions include/emp/web/TextFeed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace web {
class TextFeed : public internal::WidgetFacet<TextFeed> {
friend class TextFeedInfo;
protected:

#ifndef DOXYGEN_SHOULD_SKIP_THIS
class TextFeedInfo : public internal::WidgetInfo {
friend TextFeed;
protected:
Expand Down Expand Up @@ -72,7 +72,7 @@ namespace web {
public:
virtual std::string GetType() override { return "web::TextFeedInfo"; }
}; // End of TextFeedInfo

#endif // DOXYGEN_SHOULD_SKIP_THIS

// Get a properly cast version of info.
TextFeedInfo * Info() { return (TextFeedInfo *) info; }
Expand Down
4 changes: 4 additions & 0 deletions include/emp/web/_FacetedWidget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include "../web/Widget.hpp"

#ifndef DOXYGEN_SHOULD_SKIP_THIS

namespace emp{
namespace web{
namespace internal{
Expand All @@ -25,3 +27,5 @@ namespace web{
}
}
}

#endif
6 changes: 4 additions & 2 deletions include/emp/web/_MochaTestRunner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace web {
> documents;

public:
/// @document_ids vector of HTML IDs of divs to attach to
/// @param document_ids vector of HTML IDs of divs to attach to
BaseTest(const emp::vector<std::string> document_ids={}) {

for (const auto & id : document_ids) {
Expand All @@ -60,7 +60,7 @@ namespace web {

}

// Remember to clean up after your test!
/// Remember to clean up after your test!
virtual ~BaseTest() { ; }

/// Describe is run after construction.
Expand Down Expand Up @@ -128,9 +128,11 @@ namespace web {
emp::Signal<void()> after_each_test_sig; ///< Is triggered after each test (after test marked 'done', but before test is deleted).
std::deque<TestRunner> test_runners; ///< Store test runners in a first-in-first-out (out=run) queue

#ifndef DOXYGEN_SHOULD_SKIP_THIS
const size_t next_test_js_func_id;
const size_t pop_test_js_func_id;
const size_t cleanup_all_js_func_id;
#endif // DOXYGEN_SHOULD_SKIP_THIS

/// Run the next test!
void NextTest() {
Expand Down
3 changes: 3 additions & 0 deletions include/emp/web/d3/visualizations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ class LineGraph : public D3Visualization {

// Callback functions for accessing and scaling data

#ifndef DOXYGEN_SHOULD_SKIP_THIS
//Callback function for getting unscaled x value of data point (used as key function for data binding)
std::function<double(DATA_TYPE)> return_x = [](DATA_TYPE d){ return d[0]; };

Expand All @@ -366,6 +367,8 @@ class LineGraph : public D3Visualization {
return x_scale->ApplyScale(this->return_x(d));
};

#endif // DOXYGEN_SHOULD_SKIP_THIS

public:

LineGraph(std::string x_var="", std::string y_var="", int w=800, int h=400) : D3Visualization(w, h){
Expand Down

0 comments on commit 8eca3ba

Please sign in to comment.