add show code btn and rewrite its directive