Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DOI information to the json syntax file #1115

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/cltools/GenJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ int GenJson::main(FILE* in, FILE*out,Communicator& pc) {
// Now output keyword information
Keywords keys; actionRegister().getKeywords( action_names[i], keys );
std::cout<<" \"displayname\" : \""<<keys.getDisplayName()<<"\",\n";
//
std::cout<<" \"dois\" : [";
unsigned ndoi = keys.getDOIList().size();
if( ndoi>0 ) {
std::cout<<"\"" + keys.getDOIList()[0] + "\"";
for(unsigned j=1; j<ndoi; ++j) std::cout<<", \"" + keys.getDOIList()[j] + "\"";
}
std::cout<<"],\n";
std::cout<<" \"syntax\" : {"<<std::endl;
for(unsigned j=0; j<keys.size(); ++j) {
std::string desc = keys.getKeywordDescription( keys.getKeyword(j) );
Expand Down
1 change: 1 addition & 0 deletions src/clusters/ClusteringBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace clusters {
void ClusteringBase::registerKeywords( Keywords& keys ) {
matrixtools::MatrixOperationBase::registerKeywords( keys ); keys.use("ARG");
keys.setValueDescription("vector with length that is equal to the number of rows in the input matrix. Elements of this vector are equal to the cluster that each node is a part of");
keys.addDOI("https://doi.org/10.1021/acs.jctc.6b01073");
}

ClusteringBase::ClusteringBase(const ActionOptions&ao):
Expand Down
8 changes: 8 additions & 0 deletions src/tools/Keywords.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,4 +716,12 @@ std::string Keywords::getDisplayName() const {
return thisactname;
}

void Keywords::addDOI( const std::string& doi ) {
doilist.push_back( doi );
}

const std::vector<std::string>& Keywords::getDOIList() const {
return doilist;
}

}
6 changes: 6 additions & 0 deletions src/tools/Keywords.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ class Keywords {
std::vector<std::string> neededActions;
/// List of suffixes that can be used with this action
std::vector<std::string> actionNameSuffixes;
/// List of doi's that should appear in the manual
std::vector<std::string> doilist;
/// Print the documentation for the jth keyword in html
void print_html_item( const std::string& ) const;
public:
Expand Down Expand Up @@ -199,6 +201,10 @@ class Keywords {
std::string getDisplayName() const ;
/// Set the display name
void setDisplayName( const std::string& name );
/// Add a DOI to the list in the manual page for this action
void addDOI( const std::string& doi );
/// Get the list of DOI
const std::vector<std::string>& getDOIList() const ;
};

}
Expand Down
Loading