Skip to content

Instantly share code, notes, and snippets.

@arsho
Created April 10, 2020 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arsho/ab43e3388dfab160a31fec15925dbd43 to your computer and use it in GitHub Desktop.
Save arsho/ab43e3388dfab160a31fec15925dbd43 to your computer and use it in GitHub Desktop.
Extract features and generate readme list from https://www.django-cms.org/en/features/list/
$count_section = 1;
$count_subsection = 1;
$self_service = "Self service";
$third_party = "Via add-ons or third-party services";
$final_string = "";
$(".table tr").each(function(item, data){
$tr = $(this);
if($tr.attr("class") == "active"){
$section_title = $tr.children("td:first").text();
$final_string += $count_section+". #### "+$section_title+":"+"\n";
$count_section++;
$count_subsection = 1;
}
else{
$subsection_title = $tr.children("td:first").text();
$td_value = $tr.children("td:nth-child(2)").text();;
if($td_value == "●"){
$value = $self_service;
}
else if($td_value == "○"){
$value = $third_party;
}
else{
$value = $td_value;
}
$final_string += " "+$count_subsection+". <b>"+$subsection_title+"</b>: "+$value+"\n";
$count_subsection++;
}
})
console.log($final_string);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment